Skip to content

Commit

Permalink
Merge pull request #2040 from nextcloud/firefox-svg-workaround-fix
Browse files Browse the repository at this point in the history
Apply firefox workaroud to svg filters
  • Loading branch information
MorrisJobke authored Nov 8, 2016
2 parents 8d7df51 + d3d49c1 commit 8d47451
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -1841,11 +1841,13 @@ OC.Util.History = {
// https://bugzilla.mozilla.org/show_bug.cgi?id=652991
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if (isFirefox && parseInt(navigator.userAgent.split('/').pop()) < 51) {
var patterns = document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"]');
var patterns = document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]');
for (var i = 0, ii = patterns.length, pattern; i < ii; i++) {
pattern = patterns[i];
pattern.style.fill = pattern.style.fill;
pattern.style.stroke = pattern.style.stroke;
pattern.removeAttribute("filter");
pattern.setAttribute("filter", "url(#invert)");
}
}
if (replace) {
Expand Down

0 comments on commit 8d47451

Please sign in to comment.