diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-09-16 13:51:48 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-09-16 13:51:48 +0200 |
| commit | 00a4fe922942dc89a542f22ee4f52d3406e33b4f (patch) | |
| tree | 47e885cd287847c70a66e5f050437c77ed4ec0fc /addons | |
| parent | ef0d17312108a18a5a529e1b9140ede5f3b9d890 (diff) | |
[IMP] website: snippet: css auto hide
bzr revid: chm@openerp.com-20130916115148-wx6a1ux1iq0dupyg
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website/static/src/css/editor.css | 5 | ||||
| -rw-r--r-- | addons/website/static/src/css/editor.sass | 5 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.js | 11 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.editor.xml | 2 | ||||
| -rw-r--r-- | 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 @@ <!-- Snippets --> <t t-name="website.snippets"> - <div id='oe_snippets' style="margin-top: -170px"> + <div id='oe_snippets'> <ul class="nav nav-pills"> <li class="active"><a data-toggle="pill" href="#snippet_structure">Structure</a></li> <li class=""><a data-toggle="pill" href="#snippet_content">Content</a></li> diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index 7ddd483a6fb..f40966c89b7 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -4,7 +4,7 @@ <templates id="template" xml:space="preserve"> <t t-name="website.editorbar"> - <div class="navbar navbar-inverse navbar-fixed-top"> + <div id="website-top-navbar" class="navbar navbar-inverse navbar-fixed-top"> <div id="website-top-view"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-edit-collapse"> |
