X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/470817c5149ca294bd929fb29632a91c985aef0a..b9bce2dc718a9146a202057e4bb1809927d9caf6:/project/static/js/editor.js?ds=inline diff --git a/project/static/js/editor.js b/project/static/js/editor.js index 0cbb9341..79b7fa90 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)) ); @@ -425,7 +423,7 @@ Editor.prototype.saveToBranch = function(msg) if(self.autosaveTimer) { clearTimeout(self.autosaveTimer); } - if (data.warnings === null) { + if (data.warnings === null || data.warning === undefined) { self.showPopup('save-successful'); } else { self.showPopup('save-warn', data.warnings[0]);