diff options
| author | chm@openerp.com <> | 2014-03-31 11:52:53 +0200 |
|---|---|---|
| committer | chm@openerp.com <> | 2014-03-31 11:52:53 +0200 |
| commit | f97a237b4becb4302ffa04d7a79e0ad53aa2bc05 (patch) | |
| tree | 84f64d7d8afcb6bb1b57402d12a3bc075bc98a43 /addons/website/static/src/js/website.snippets.editor.js | |
| parent | e94c9eea4e61f3cfdfde0197eea7835cf64db347 (diff) | |
[WIP] website: media editor
bzr revid: chm@openerp.com-20140331095253-zftyl4uvd56mpovj
Diffstat (limited to 'addons/website/static/src/js/website.snippets.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.snippets.editor.js | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index dc66e04bd0b..0e0290b825c 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1430,13 +1430,12 @@ } }); - website.snippet.options.media = website.snippet.Option.extend({ + website.snippet.options.transform = website.snippet.Option.extend({ start: function () { var self = this; this._super(); website.snippet.start_animation(true, this.$target); - this.$el.find('[data-toggle="dropdown"]').dropdown(); this.$el.find(".edition").click(function (event) { event.preventDefault(); event.stopPropagation(); @@ -1455,29 +1454,27 @@ 'top': pos.top, 'left': pos.left, 'position': 'absolute', - 'height': '20px', - 'width': '160px' - }); - self.$overlay.find('.oe_overlay_options').css({ - 'position': 'static' }); + self.$overlay.find(".oe_overlay_options").attr("style", "width:0; left:0!important; top:0;"); + self.$overlay.find(".oe_overlay_options > .btn-group").attr("style", "width:160px; left:-80px;"); }}); this.$target.data('transfo').$markup .on("mouseover", function () { self.$target.trigger("mouseover"); }) - .mouseover() - .click(function () { - self.$target.transfo({ hide: false }); - }); + .mouseover(); this.$el.find(".style").click(function (event) { var settings = self.$target.data("transfo").settings; self.$target.transfo({ hide: (settings.hide = !settings.hide) }); }); - }, - onFocus : function () { - this.$target.transfo({ hide: true }); + + this.$overlay.find('.oe_snippet_clone, .oe_handles').addClass('hidden'); + + this.$overlay.find('[data-toggle="dropdown"]') + .on("mousedown", function () { + self.$target.transfo({ hide: true }); + }); }, onBlur : function () { this.$target.transfo({ hide: true }); @@ -1493,7 +1490,6 @@ this.snippet_id = this.$target.data("snippet-id"); this._readXMLData(); this.load_style_options(); - this.get_transform(); this.get_parent_block(); this.start(); }, @@ -1635,24 +1631,6 @@ this.$overlay.find('[data-toggle="dropdown"]').dropdown(); }, - get_transform: function () { - var self = this; - var phantom = false; - for (var i in this.styles){ - if (this.styles[i].data.phantom) { - phantom = true; - break; - } - } - if (phantom) { - // var $parent = this.$target.parents(website.snippet.globalSelector).first(); - // setTimeout(function () { - // self.BuildingBlock.make_active($parent); - // }, 0); - this.$overlay.find('.oe_snippet_clone, .oe_handles').addClass('hidden'); - } - }, - get_parent_block: function () { var self = this; var $button = this.$overlay.find('.oe_snippet_parent'); |
