Browse Source

prevent double push css

Nicolas Cannasse 5 months ago
parent
commit
a102b5b8b5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      hrt/impl/DomkitViewer.hx

+ 2 - 0
hrt/impl/DomkitViewer.hx

@@ -726,6 +726,8 @@ class DomkitStyle extends h2d.domkit.Style {
 	static var CSS_SOURCES = [];
 	static var CSS_SOURCES = [];
 	static var CONTENT = new Map();
 	static var CONTENT = new Map();
 	public static function registerCSSSource( path : String, ?content : String ) {
 	public static function registerCSSSource( path : String, ?content : String ) {
+		if( CSS_SOURCES.indexOf(path) >= 0 )
+			return false;
 		CSS_SOURCES.push(path);
 		CSS_SOURCES.push(path);
 		if( content != null ) CONTENT.set(path, content);
 		if( content != null ) CONTENT.set(path, content);
 		return true;
 		return true;