Explorar el Código

Merge pull request #30 from sharelatex/pr-fix-chrome-61-62-shadow

Fix chrome 61 and 62 shadow
Paulo Jorge Reis hace 9 años
padre
commit
6996f52195
Se han modificado 1 ficheros con 14 adiciones y 0 borrados
  1. 14 0
      services/web/public/coffee/ide.coffee

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

@@ -191,6 +191,20 @@ 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)
+			)
+			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]