X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f31bb368a2cad9a61e4fc652fa4b40c4114a128c..889882b4d84fb826afc834040b203dff2fb4a224:/project/static/js/editor.ui.js diff --git a/project/static/js/editor.ui.js b/project/static/js/editor.ui.js index 59c3f754..aed04553 100755 --- a/project/static/js/editor.ui.js +++ b/project/static/js/editor.ui.js @@ -15,6 +15,11 @@ Editor.prototype.setupUI = function() { var resize_changed = function(event) { var old_width = parseInt(event.data.overlay.css('width')); var delta = event.pageX + event.data.hotspot_x - old_width; + + if(old_width + delta < 12) delta = 12 - old_width; + if(old_width + delta > $(window).width()) + delta = $(window).width() - old_width; + event.data.overlay.css({ 'width': old_width + delta }); @@ -104,7 +109,7 @@ Editor.prototype.setupUI = function() { panel_root.bind('hpanel:panel-resize-start', resize_start); self.rootDiv.bind('stopResize', function() { - self.savePanelOptions() + self.savePanelOptions(); }); /* @@ -127,11 +132,15 @@ Editor.prototype.setupUI = function() { function() { panel.refresh(); } ); + + self.rootDiv.bind('stopResize', function() { + panel.callHook('toolbarResized'); + }); }); $(document).bind('panel:contentChanged', function() { self.onContentChanged.apply(self, arguments) - }); + }); /* * Connect various buttons @@ -206,8 +215,8 @@ Editor.prototype.loadSplitDialog = function(hash) // put the form into the window $('div.container-box', hash.w).html(data); $("div.loading-box", hash.w).hide(); - $('form input[name=splittext]', hash.w).val(hash.t.selection); - $('form input[name=fulltext]', hash.w).val(hash.t.fulltext); + $('form input[name=splitform-splittext]', hash.w).val(hash.t.selection); + $('form input[name=splitform-fulltext]', hash.w).val(hash.t.fulltext); $('div.container-box', hash.w).show(); // connect buttons @@ -225,6 +234,19 @@ Editor.prototype.loadSplitDialog = function(hash) $('#split-dialog-button-dismiss').click(function() { hash.w.jqmHide(); $('div.container-box', hash.w).html(''); + hash.t.success(); + }); + + if($('#id_splitform-autoxml').is(':checked')) + $('#split-form-dc-subform').show(); + else + $('#split-form-dc-subform').hide(); + + $('#id_splitform-autoxml').change(function() { + if( $(this).is(':checked') ) + $('#split-form-dc-subform').show(); + else + $('#split-form-dc-subform').hide(); }); }; @@ -250,8 +272,11 @@ Editor.prototype.refreshPanels = function() { else panel.refresh(); }); -}; + $('#toolbar-button-save').attr('disabled', 'disabled'); + $('#toolbar-button-commit').removeAttr('disabled'); + $('#toolbar-button-update').removeAttr('disabled'); +}; /* * Pop-up messages