summaryrefslogtreecommitdiff
path: root/addons/website
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2014-03-24 14:38:11 +0100
committerChristophe Simonis <chs@openerp.com>2014-03-24 14:38:11 +0100
commitd93b79e6f4e5c6c2fda65fbf88df8e1851b6fa4d (patch)
treef855bc221056bf09cd4713d6cd44ab6b1449a268 /addons/website
parent7c4557add24726f34fec3aa834c34fa5c9b1f17f (diff)
parentf4b1d23cf2b44521456b479c1038e17d5ee0bac8 (diff)
[MERGE] forward port of branch saas-3 up to revid 9345 dle@openerp.com-20140324110349-e82t1bmmtjqbl85k
bzr revid: chs@openerp.com-20140324133811-4az1kvbznd26seow
Diffstat (limited to 'addons/website')
-rw-r--r--addons/website/models/ir_ui_view.py13
-rw-r--r--addons/website/static/src/js/website.editor.js3
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js16
3 files changed, 6 insertions, 26 deletions
diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py
index 857b99d40d2..67781cc02a0 100644
--- a/addons/website/models/ir_ui_view.py
+++ b/addons/website/models/ir_ui_view.py
@@ -168,20 +168,9 @@ class view(osv.osv):
arch_no_whitespace = etree.fromstring(
etree.tostring(arch, encoding='utf-8'),
parser=etree.XMLParser(encoding='utf-8', remove_blank_text=True))
- arch_pretty_indent_2 = etree.tostring(
+ return etree.tostring(
arch_no_whitespace, encoding='unicode', pretty_print=True)
- # pretty_print uses a fixed indent level of 2, we want an indent of 4,
- # double up leading spaces.
- def repl(m):
- indent = len(m.group(0)) / 2
- return u' ' * 4 * indent
- # FIXME: If py2.7 only, can use re.M in sub and don't have to do replacement line by line
- return u'\n'.join(
- re.sub(ur'^((?: )+)', repl, line)
- for line in arch_pretty_indent_2.split(u'\n')
- )
-
def save(self, cr, uid, res_id, value, xpath=None, context=None):
""" Update a view section. The view section may embed fields to write
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index c89bf9ec2fb..ae126ad16ab 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -1789,6 +1789,9 @@
if (node.nodeName === 'BR' && node.getAttribute('type') === '_moz') {
// <br type="_moz"> appears when focusing RTE in FF, ignore
continue;
+ } else if (node.nodeName === 'DIV' && $(node).hasClass('oe_drop_zone')) {
+ // ignore dropzone inserted by snippets
+ continue
}
}
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index 1eee1fee65b..084dcd0b249 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -19,23 +19,11 @@
edit: function () {
var self = this;
$("[data-oe-model] *, [data-oe-type=html] *").off('click');
- website.snippet.stop_animation();
window.snippets = this.snippets = new website.snippet.BuildingBlock(this);
this.snippets.appendTo(this.$el);
this.on('rte:ready', this, function () {
self.snippets.$button.removeClass("hidden");
- website.snippet.start_animation();
- $(website.snippet.readyAnimation).each(function() {
- var animation = $(this).data("snippet-view");
- if (animation) {
- animation.$target.on('focus', '*', function(){
- animation.stop();
- });
- animation.$target.on('blur', '*', function(){
- animation.start();
- });
- }
- });
+ website.snippet.stop_animation();
});
return this._super.apply(this, arguments);
@@ -397,7 +385,6 @@
$("#oe_snippets").trigger('snippet-dropped', $target);
website.snippet.start_animation(true, $target);
-
// drop_and_build_snippet
self.create_overlay($target);
if ($target.data("snippet-editor")) {
@@ -1291,6 +1278,7 @@
this.grid.size = 8;
return this.grid;
},
+ this.$target.carousel({interval: false});
});
website.snippet.options.parallax = website.snippet.Option.extend({