From: Ɓukasz Rekucki Date: Fri, 11 Sep 2009 17:23:49 +0000 (+0200) Subject: Iframe height change fix. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/9b10c9eeb755d831eb0c6f047931af30d954f719 Iframe height change fix. Resize boundries are now set at (12, window.width()) --- diff --git a/project/static/js/editor.js b/project/static/js/editor.js index cee04dbb..69c27b1e 100644 --- a/project/static/js/editor.js +++ b/project/static/js/editor.js @@ -45,7 +45,7 @@ Panel.prototype.callHook = function() { var noHookAction = args.splice(0,1)[0] var result = false; - // $.log('calling hook: ', hookName, 'with args: ', args); + $.log('calling hook: ', hookName, 'with args: ', args); if(this.hooks && this.hooks[hookName]) result = this.hooks[hookName].apply(this, args); else if (noHookAction instanceof Function) @@ -146,6 +146,7 @@ Panel.prototype.connectToolbar = function() var extra_buttons = $('span.panel-toolbar-extra', toolbar); var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap); placeholder.replaceWith(extra_buttons); + extra_buttons.hide(); var action_buttons = $('button', extra_buttons); diff --git a/project/static/js/editor.ui.js b/project/static/js/editor.ui.js index 41025fa0..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 }); @@ -135,9 +140,7 @@ Editor.prototype.setupUI = function() { $(document).bind('panel:contentChanged', function() { self.onContentChanged.apply(self, arguments) - }); - - + }); /* * Connect various buttons diff --git a/project/templates/explorer/panels/xmleditor.html b/project/templates/explorer/panels/xmleditor.html index 3f74017d..4a8362dd 100644 --- a/project/templates/explorer/panels/xmleditor.html +++ b/project/templates/explorer/panels/xmleditor.html @@ -56,8 +56,8 @@ panel_hooks = { }, toolbarResized: function() { - $('.iframe-container', self.contentDiv).css('top', - $('.toolbar', self.contentDiv).outerHeight() ); + $('.iframe-container', this.contentDiv).css('top', + $('.toolbar', this.contentDiv).outerHeight() ); } };