diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge.widgets.js b/deluge/ui/webui/templates/ajax/static/js/deluge.widgets.js index 2f061e44f..8f46474e1 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge.widgets.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge.widgets.js @@ -840,7 +840,7 @@ Deluge.Widgets.PreferencesWindow = new Class({ this.categories = []; this.currentPage = -1; this.addEvent('loaded', this.loaded.bindWithEvent(this)); - this.addEvent('show', this.shown.bindWithEvent(this)); + this.addEvent('beforeShow', this.beforeShown.bindWithEvent(this)); }, loaded: function(event) { @@ -921,8 +921,8 @@ Deluge.Widgets.PreferencesWindow = new Class({ }); this.webui.apply(); }, - - shown: function(event) { + + beforeShown: function(event) { // we want this to be blocking var config = Deluge.Client.get_config({async: false}); diff --git a/deluge/ui/webui/templates/ajax/static/js/mooui.js b/deluge/ui/webui/templates/ajax/static/js/mooui.js index 08599d554..ca3da5e05 100644 --- a/deluge/ui/webui/templates/ajax/static/js/mooui.js +++ b/deluge/ui/webui/templates/ajax/static/js/mooui.js @@ -1021,7 +1021,7 @@ Widgets.Window = new Class({ width: this.options.width, height: this.options.height }); - this.element.setStyle('opacity', 0) + this.element.setStyle('opacity', 0); this.title = new Element('h3').addClass('mooui-window-title'); this.element.grab(this.title); this.title.set('text', this.options.title); @@ -1033,8 +1033,8 @@ Widgets.Window = new Class({ this.close = new Element('div').addClass('mooui-window-close'); this.close.inject(this.element); this.close.addEvent('click', function(e) { - this.hide() - }.bindWithEvent(this)) + this.hide(); + }.bindWithEvent(this)); this.content = new Element('div').addClass('mooui-window-content'); this.content.inject(this.element); @@ -1044,22 +1044,23 @@ Widgets.Window = new Class({ url: this.options.url, update: this.content, onSuccess: function(e) { - this.fireEvent('loaded') + this.fireEvent('loaded'); }.bindWithEvent(this) - }).get() + }).get(); } }, show: function() { - var size = document.body.getInnerSize() - var left = (size.x - this.options.width) / 2, top = (size.y - this.options.height) / 2 + this.fireEvent('beforeShow'); + var size = document.body.getInnerSize(); + var left = (size.x - this.options.width) / 2, top = (size.y - this.options.height) / 2; this.sets({ left: left, top: top - }) - document.body.grab(this.element) - this.element.setStyle('opacity', 1) - this.fireEvent('show') + }); + document.body.grab(this.element); + this.element.setStyle('opacity', 1); + this.fireEvent('show'); }, hide: function() {