Fixed missing buttons when switching too much.
authorŁukasz Rekucki <lrekucki@gmail.com>
Tue, 22 Sep 2009 12:31:54 +0000 (14:31 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Tue, 22 Sep 2009 12:31:54 +0000 (14:31 +0200)
project/static/css/toolbar.css
project/static/js/editor.js
project/templates/explorer/editor.html

index 4c5fa74..a54dc55 100644 (file)
     line-height: 12px;
 }
 
-.toolbar button {
-    border: none;
-    padding: 2px 0.5em;
-    background: #AAA;
-    font-family: Sans-Serif;
-}
-
 .toolbar div {
     background: green;
     margin: 0px;
     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;
index f94d33c..94b4ca9 100644 (file)
@@ -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(
+            '<span />');
         
         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);
 
index 428f354..22a60f6 100644 (file)
                         {% endfor %}
                     </select>
                     </label>
-                    <span class="toolbar-button-groups-container">
-                    <span class="panel-toolbar-extra" > </span>
+
+                    <span
+                    <span class="toolbar-buttons-container panel-toolbar-extra">
+                        </span>
                     </span>
                     <!-- rethink the refresh button - it doesn't work very well -->
                     <!-- <button type="button" class="refresh-button">Odśwież</button> -->