From e49688b94d3f0f2e72efc2b66f77a5c148aa7ea2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Tue, 22 Sep 2009 14:31:54 +0200 Subject: [PATCH] Fixed missing buttons when switching too much. --- project/static/css/toolbar.css | 23 ++++++++++++----------- project/static/js/editor.js | 10 +++++----- project/templates/explorer/editor.html | 6 ++++-- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/project/static/css/toolbar.css b/project/static/css/toolbar.css index 4c5fa740..a54dc558 100644 --- a/project/static/css/toolbar.css +++ b/project/static/css/toolbar.css @@ -21,13 +21,6 @@ line-height: 12px; } -.toolbar button { - border: none; - padding: 2px 0.5em; - background: #AAA; - font-family: Sans-Serif; -} - .toolbar div { background: green; margin: 0px; @@ -38,24 +31,32 @@ background: #DDD; } -.toolbar-button-groups-container p { +.toolbar-buttons-container { background: #DDD; padding-top: 2px; padding-bottom: 2px; } -.toolbar-button-groups-container button { +.toolbar-buttons-container button { background: #DDD; + border: none; + padding: 2px 0.5em; + background: #AAA; + font-family: Sans-Serif; } -.toolbar-button-groups-container button:hover { +.toolbar-buttons-container button:hover { background: #EEE; } -.toolbar-button-groups-container button:active { +.toolbar-buttons-container button:active { background: yellow; } +.panel-toolbar-extra button { + background: inherit; +} + /* .toolbar, .toolbar ol { display: block; diff --git a/project/static/js/editor.js b/project/static/js/editor.js index f94d33c4..94b4ca97 100644 --- a/project/static/js/editor.js +++ b/project/static/js/editor.js @@ -92,7 +92,8 @@ Panel.prototype.unload = function(event, data) { $(this.contentDiv).html(''); // disconnect the toolbar - $('div.panel-toolbar span.panel-toolbar-extra', this.wrap).empty(); + $('div.panel-toolbar span.panel-toolbar-extra', this.wrap).html( + ''); this.callHook('unload'); this.hooks = null; // flush the hooks @@ -149,10 +150,9 @@ Panel.prototype.connectToolbar = function() if(toolbar.length === 0) return; // move the extra - var extra_buttons = $('span.panel-toolbar-extra', toolbar); - var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap); - placeholder.replaceWith(extra_buttons); - placeholder.hide(); + var extra_buttons = $('span.panel-toolbar-extra button', toolbar); + var placeholder = $('div.panel-toolbar span.panel-toolbar-extra > span', this.wrap); + placeholder.replaceWith(extra_buttons); var action_buttons = $('button', extra_buttons); diff --git a/project/templates/explorer/editor.html b/project/templates/explorer/editor.html index 428f3546..22a60f60 100644 --- a/project/templates/explorer/editor.html +++ b/project/templates/explorer/editor.html @@ -68,8 +68,10 @@ {% endfor %} - - + + + -- 2.20.1