X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d96e0c45b35295d3e6012b8e2c93fe42d8d72ca9..c6fc086238de9fefb56169edc148bbcd3ff866fa:/project/static/js/editor.js diff --git a/project/static/js/editor.js b/project/static/js/editor.js index f94d33c4..f52950ff 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,12 +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 action_buttons = $('button', extra_buttons); + 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); // connect group-switch buttons var group_buttons = $('*.toolbar-tabs-container button', toolbar); @@ -185,7 +183,7 @@ Panel.prototype.connectToolbar = function() }); // connect action buttons - var allbuttons = $.makeArray(action_buttons); + var allbuttons = $.makeArray(extra_buttons); $.merge(allbuttons, $.makeArray($('*.toolbar-button-groups-container button', toolbar)) ); @@ -322,30 +320,30 @@ Editor.prototype.loadConfig = function() { }; Editor.prototype.loadPanelOptions = function() { - var self = this; - var totalWidth = 0; - - $('.panel-wrap', self.rootDiv).each(function(index) { - var panelWidth = self.fileOptions.panels[index].ratio * self.rootDiv.width(); - if ($(this).hasClass('last-panel')) { - $(this).css({ - left: totalWidth, - right: 0 - }); - } else { - $(this).css({ - left: totalWidth, - width: panelWidth - }); - totalWidth += panelWidth; - } - $.log('panel:', this, $(this).css('left')); - $('.panel-toolbar option', this).each(function() { - if ($(this).attr('p:panel-name') == self.fileOptions.panels[index].name) { - $(this).parent('select').val($(this).attr('value')); - } - }); - }); + // var self = this; + // var totalWidth = 0; + // + // $('.panel-wrap', self.rootDiv).each(function(index) { + // var panelWidth = self.fileOptions.panels[index].ratio * self.rootDiv.width(); + // if ($(this).hasClass('last-panel')) { + // $(this).css({ + // left: totalWidth, + // right: 0 + // }); + // } else { + // $(this).css({ + // left: totalWidth, + // width: panelWidth + // }); + // totalWidth += panelWidth; + // } + // $.log('panel:', this, $(this).css('left')); + // $('.panel-toolbar option', this).each(function() { + // if ($(this).attr('p:panel-name') == self.fileOptions.panels[index].name) { + // $(this).parent('select').val($(this).attr('value')); + // } + // }); + // }); }; Editor.prototype.savePanelOptions = function() { @@ -576,5 +574,5 @@ $(function() { // do the layout editor.loadConfig(); - editor.setupUI(); + editor.setupUI(); });