From 00a4fe922942dc89a542f22ee4f52d3406e33b4f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 16 Sep 2013 13:51:48 +0200 Subject: [PATCH] [IMP] website: snippet: css auto hide bzr revid: chm@openerp.com-20130916115148-wx6a1ux1iq0dupyg --- addons/website/static/src/css/editor.css | 5 +++++ addons/website/static/src/css/editor.sass | 5 +++++ addons/website/static/src/js/website.snippets.js | 11 +++-------- addons/website/static/src/xml/website.editor.xml | 2 +- addons/website/static/src/xml/website.xml | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 4d9563fafa2..4661217b8a8 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -125,6 +125,7 @@ table.editorbar-panel td.selected { /* ---- SNIPPET EDITOR ---- */ #oe_snippets { + display: none; position: fixed; left: 0px; right: 0px; @@ -147,6 +148,10 @@ table.editorbar-panel td.selected { height: 140px; } +#website-top-navbar:hover #oe_snippets { + display: block; +} + .oe_snippet { display: inline-block; vertical-align: top; diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 308a3a6b017..58801bed5f4 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -116,7 +116,9 @@ table.editorbar-panel /* ---- SNIPPET EDITOR ---- */ + #oe_snippets + display: none position: fixed left: 0px right: 0px @@ -135,6 +137,9 @@ table.editorbar-panel .pill-content height: 140px +#website-top-navbar:hover #oe_snippets + display: block + .oe_snippet display: inline-block vertical-align: top diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index 6584ba7371e..802c9438885 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -7,8 +7,7 @@ website.EditorBar.include({ edit: function () { window.snippets = this.snippets = new website.snippet.BuildingBlock(this); - this.snippets.insertAfter(this.$el); - this.snippets.show(); + this.snippets.appendTo(this.$el); return this._super.apply(this, arguments); }, save: function () { @@ -96,14 +95,10 @@ $el.css($target.offset()); }, show: function () { - this.$el.css('margin-top', '0px'); - $('body').trigger('resize'); - $("body").css('padding-top', '220px'); + this.$el.css("display", ""); }, hide: function () { - this.$el.css('margin-top', '-170px'); - $("body").css('padding-top', '50px'); - $('body').trigger('resize'); + this.$el.hide(); }, bind_snippet_click_editor: function () { diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml index 5424d418717..08b3c4e63be 100644 --- a/addons/website/static/src/xml/website.editor.xml +++ b/addons/website/static/src/xml/website.editor.xml @@ -165,7 +165,7 @@ -
+