Преглед изворни кода

added priority "important" to singlefile ui element styles

Gildas пре 7 година
родитељ
комит
8b4d665f00
2 измењених фајлова са 4 додато и 4 уклоњено
  1. 3 3
      extension/ui/content/content-ui.js
  2. 1 1
      extension/ui/content/infobar.js

+ 3 - 3
extension/ui/content/content-ui.js

@@ -37,8 +37,8 @@ this.singlefile.ui = this.singlefile.ui || (() => {
 				maskElement.style.top = "0px";
 				maskElement.style.left = "0px";
 				maskElement.style.height = "100%";
-				maskElement.style.width = "100%";				
-				maskElement.style.zIndex = 2147483647;				
+				maskElement.style.width = "100%";
+				maskElement.style.zIndex = 2147483647;
 				maskElement.style.transition = "opacity 250ms";
 				maskElement.style.willChange = "opacity background-color";
 				const progressBarElement = createElement(PROGRESS_BAR_TAGNAME, maskElement);
@@ -77,7 +77,7 @@ this.singlefile.ui = this.singlefile.ui || (() => {
 	function createElement(tagName, parentElement) {
 		const element = document.createElement(tagName);
 		parentElement.appendChild(element);
-		Array.from(getComputedStyle(element)).forEach(property => element.style[property] = "initial");
+		Array.from(getComputedStyle(element)).forEach(property => element.style.setProperty(property, "initial", "important"));
 		return element;
 	}
 

+ 1 - 1
extension/ui/content/infobar.js

@@ -123,7 +123,7 @@ this.singlefile.infobar = this.singlefile.infobar || (() => {
 	function createElement(tagName, parentElement) {
 		const element = document.createElement(tagName);
 		parentElement.appendChild(element);
-		Array.from(getComputedStyle(element)).forEach(property => element.style[property] = "initial");
+		Array.from(getComputedStyle(element)).forEach(property => element.style.setProperty(property, "initial", "important"));
 		return element;
 	}