diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge.js b/deluge/ui/webui/templates/ajax/static/js/deluge.js index 966fd5fdd..40e67b3a9 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge.js @@ -57,7 +57,7 @@ Deluge.UI = { window.addEvent('resize', this.bound.resized); Deluge.UI.update(); - $('overlay').destroy(); + this.overlay = $('overlay').dispose(); }, initialize_grid: function() { @@ -146,11 +146,20 @@ Deluge.UI = { }, setTheme: function(name, fn) { + if (this.overlay) { + this.overlay.inject(document.body); + } this.theme = name; if (this.themecss) this.themecss.destroy(); this.themecss = new Asset.css('/template/static/themes/' + name + '/style.css'); Cookie.write('theme', name); - if (this.vbox) this.vbox.refresh(); + if (this.overlay) { + var temp = function() { + this.vbox.refresh(); + this.vbox.calculatePositions(); + this.overlay.dispose(); + }.bind(this).delay(100); + }; }, run: function() { diff --git a/deluge/ui/webui/templates/ajax/static/js/mooui.js b/deluge/ui/webui/templates/ajax/static/js/mooui.js index ca3da5e05..0c2773dc8 100644 --- a/deluge/ui/webui/templates/ajax/static/js/mooui.js +++ b/deluge/ui/webui/templates/ajax/static/js/mooui.js @@ -366,10 +366,11 @@ Widgets.Base = new Class({ }, refresh: function() { + this.element.removeProperty('style'); this.width = (this.options.width) ? this.options.width : this.element.getStyle('width').toInt() this.height = (this.options.height) ? this.options.height : this.element.getStyle('height').toInt() this.getSizeModifiers(); - if (this.calculatePositions) this.calculatePositions(); + if (this.refreshChildren) this.refreshChildren(); }, expand: function() { @@ -959,8 +960,8 @@ Widgets.VBox = new Class({ box = $W(box) box.boxinfo = (options) ? options : {fixed: false}; this.boxes.include(box); - this.element.grab(box) - box.element.setStyle('position', 'absolute') + this.element.grab(box); + box.element.setStyle('position', 'absolute'); }, calculatePositions: function() { @@ -990,6 +991,7 @@ Widgets.VBox = new Class({ boxinfo.width = size.x - box.element.modifiers.x boxinfo.top = position.y boxinfo.left = position.x + box.sets({ height: boxinfo.height, width: boxinfo.width, @@ -998,6 +1000,13 @@ Widgets.VBox = new Class({ }) position.y += box.height + box.element.modifiers.y }, this) + }, + + refreshChildren: function() { + this.boxes.each(function(box) { + box.refresh(); + box.element.setStyle('position', 'absolute'); + }); } }) /*