X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/970685936cdd7b70e3efa2f2506f66198049b16d..5620e337719f6e64efaf77ec702c7d6848cc7255:/project/static/js/editor.ui.js?ds=sidebyside diff --git a/project/static/js/editor.ui.js b/project/static/js/editor.ui.js index b27daace..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,9 +109,9 @@ Editor.prototype.setupUI = function() { panel_root.bind('hpanel:panel-resize-start', resize_start); self.rootDiv.bind('stopResize', function() { - self.savePanelOptions() + self.savePanelOptions(); }); - + /* * Connect panel actions */ @@ -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