Skip to content

Commit 4c7e295

Browse files
[ide] Even better css reload
1 parent ddb3684 commit 4c7e295

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bin/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
}
149149

150150
if (ext == "css") {
151-
hide.Ide.inst.reloadCss();
151+
hide.Ide.inst.reloadCss(file);
152152
};
153153
});
154154
</script>

hide/Ide.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,13 @@ class Ide extends hide.tools.IdeData {
793793
js.Browser.location.reload();
794794
}
795795

796-
public function reloadCss() {
796+
public function reloadCss(path: String = null) {
797797
var css = new js.jquery.JQuery('link[type="text/css"]');
798798
css.each(function(i, e) : Void {
799799
var link : js.html.LinkElement = cast e;
800-
link.href = link.href + "?" + haxe.Timer.stamp();
800+
if (path == null || StringTools.contains(link.href, path)) {
801+
link.href = link.href + "?" + haxe.Timer.stamp();
802+
}
801803
});
802804
}
803805

0 commit comments

Comments
 (0)