diff options
| author | chm@openerp.com <> | 2014-04-07 12:24:19 +0200 |
|---|---|---|
| committer | chm@openerp.com <> | 2014-04-07 12:24:19 +0200 |
| commit | c7a16d134b5cdc418ccba7110dd3dbcefed39424 (patch) | |
| tree | 3a2739acb777dacbfff06f86f5f87d2eadb623b3 /addons/website/static/src/js/website.snippets.editor.js | |
| parent | cdf4636dcefc3e2fd659774b43f72c5a3c75fa61 (diff) | |
[FIX] website: media editor, editor position
bzr revid: chm@openerp.com-20140407102419-u5lrqefulj7c8ta0
Diffstat (limited to 'addons/website/static/src/js/website.snippets.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.snippets.editor.js | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 0febdb2bedd..12c8d438a15 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1438,10 +1438,25 @@ this._super(); this.$el.find(".clear-style").click(function (event) { - self.$target.removeClass("fa-spin").attr("style", null); - self.$target.transfo({ hide: true }); + self.$target.removeClass("fa-spin").attr("style", ""); + self.resetTransfo(); }); + this.$el.find(".style").click(function (event) { + var settings = self.$target.data("transfo").settings; + self.$target.transfo({ hide: (settings.hide = !settings.hide) }); + }); + + this.$overlay.find('.oe_snippet_clone, .oe_handles').addClass('hidden'); + + this.$overlay.find('[data-toggle="dropdown"]') + .on("mousedown", function () { + self.$target.transfo({ hide: true }); + }); + }, + resetTransfo: function () { + var self = this; + this.$target.transfo("destroy"); this.$target.transfo({ hide: true, callback: function () { @@ -1459,21 +1474,9 @@ self.$target.trigger("mouseover"); }) .mouseover(); - - this.$el.find(".style").click(function (event) { - var settings = self.$target.data("transfo").settings; - self.$target.transfo({ hide: (settings.hide = !settings.hide) }); - }); - - this.$overlay.find('.oe_snippet_clone, .oe_handles').addClass('hidden'); - - this.$overlay.find('[data-toggle="dropdown"]') - .on("mousedown", function () { - self.$target.transfo({ hide: true }); - }); }, onFocus : function () { - this.$target.transfo({ hide: true }); + this.resetTransfo(); }, onBlur : function () { this.$target.transfo({ hide: true }); @@ -1487,6 +1490,10 @@ website.snippet.start_animation(true, this.$target); + this.$target.on("saved", self, function (event, item) { + self.BuildingBlock.make_active($(item)); + }); + this.$el.find(".edition").click(function (event) { event.preventDefault(); event.stopPropagation(); |
