Przeglądaj źródła

Conditionally disable text-shadow on chrome v61 and v62.

Paulo Reis 9 lat temu
rodzic
commit
e41a48de72
1 zmienionych plików z 15 dodań i 0 usunięć
  1. 15 0
      services/web/public/coffee/ide.coffee

+ 15 - 0
services/web/public/coffee/ide.coffee

@@ -185,6 +185,21 @@ define [
 		if ide.browserIsSafari
 			ide.safariScrollPatcher = new SafariScrollPatcher($scope)
 
+		# Fix Chrome 61 and 62 text-shadow rendering
+		browserIsChrome61or62 = false
+		try
+			chromeVersion = parseFloat(navigator.userAgent.split(" Chrome/")[1]) || null;
+			browserIsChrome61or62 = (
+				chromeVersion? &&
+				(chromeVersion == 61 || chromeVersion == 62)
+			)
+			console.log chromeVersion, browserIsChrome61or62
+			if browserIsChrome61or62
+				document.styleSheets[0].insertRule(".ace_editor.ace_autocomplete .ace_completion-highlight { text-shadow: none !important; }", 1)
+		catch err
+			console.error err
+
+
 		# User can append ?ft=somefeature to url to activate a feature toggle
 		ide.featureToggle = location?.search?.match(/^\?ft=(\w+)$/)?[1]