[MERGE] from trunk
authorchm@openerp.com <>
Wed, 23 Apr 2014 15:48:52 +0000 (17:48 +0200)
committerchm@openerp.com <>
Wed, 23 Apr 2014 15:48:52 +0000 (17:48 +0200)
bzr revid: chm@openerp.com-20140423154852-gzegxqrzb2sj01zl

1  2 
addons/website/static/src/css/editor.css
addons/website/static/src/css/editor.sass
addons/website/static/src/js/website.editor.js
addons/website/static/src/js/website.snippets.editor.js
addons/website_report/views/layouts.xml

          },
          clean_for_save: function () {
              var self = this;
-             this.dom_filter(website.snippet.globalSelector).each(function () {
-                 var $snippet = $(this);
-                 self.make_active($snippet);
-                 self.make_active(false);
-                 var editor = $snippet.data("snippet-editor");
-                 if (editor) {
-                     editor.clean_for_save();
 -
+             $("*[contentEditable], *[attributeEditable]")
+                 .removeAttr('contentEditable')
+                 .removeAttr('attributeEditable');
+             var options = website.snippet.options;
+             var template = website.snippet.templateOptions;
+             for (var k in options) {
+                 if (template[k] && options[k].prototype.clean_for_save !== dummy) {
+                     var $snippet = this.dom_filter(template[k].selector);
+                     $snippet.each(function () {
+                         new options[k](self, null, $(this), k).clean_for_save();
+                     });
                  }
-             });
+             }
          },
          make_active: function ($snippet) {
              if ($snippet && this.$active_snipped_id && this.$active_snipped_id.get(0) === $snippet.get(0)) {