Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
polymer-ui-icon: support 4 value syntax returns from getComputedStyle
Browse files Browse the repository at this point in the history
backgroundPosition
  • Loading branch information
frankiefu committed Nov 4, 2013
1 parent a5c90fd commit 48194a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions polymer-ui-icon/polymer-ui-icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@
var themes = {};
function calcThemeOffset(theme, node) {
if (themes[theme] === undefined) {
var offset = parseFloat(
getComputedStyle(node).backgroundPosition.split(' ').shift());
var bp = getComputedStyle(node).backgroundPosition.split(' ');
// support 4 value syntax (https://code.google.com/p/chromium/issues/detail?id=310977)
var l = bp.length === 4 ? bp[1] : bp[0];
var offset = parseFloat(l);
themes[theme] = offset;
}
return themes[theme];
Expand Down

0 comments on commit 48194a7

Please sign in to comment.