mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-18 15:51:57 +00:00
improve the theme changing so it now checks to see if the stylesheet is loaded before refreshing the ui
This commit is contained in:
parent
8d05d4f2c5
commit
07f65d8a22
1 changed files with 11 additions and 3 deletions
|
@ -1120,11 +1120,19 @@ Deluge.UI = {
|
||||||
this.themecss = new Asset.css('/template/static/themes/' + name + '/style.css');
|
this.themecss = new Asset.css('/template/static/themes/' + name + '/style.css');
|
||||||
Cookie.write('theme', name);
|
Cookie.write('theme', name);
|
||||||
if (this.overlay) {
|
if (this.overlay) {
|
||||||
var temp = function() {
|
var refresh = function() {
|
||||||
this.vbox.refresh();
|
this.vbox.refresh();
|
||||||
this.vbox.calculatePositions();
|
this.vbox.calculatePositions();
|
||||||
this.overlay.dispose();
|
this.overlay.dispose();
|
||||||
}.bind(this).delay(500);
|
}.bind(this);
|
||||||
|
var check = function() {
|
||||||
|
if (document.styleSheets[2]) {
|
||||||
|
if (document.styleSheets[2].href == this.themecss.href) {
|
||||||
|
refresh();
|
||||||
|
$clear(check);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.periodical(50, this);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue