Skip to content
This repository
Browse code

made the ie plugin compatible to our jshint rules

  • Loading branch information...
commit 6f0ec000e37ca1a7d47713be471ee42d9b514c4f 1 parent 8e6b97d
Alexander Prinzhorn authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 plugins/skrollr.ie.js
11 plugins/skrollr.ie.js
@@ -16,6 +16,7 @@
16 16
17 17 skrollr.plugin('setStyle', function(el, prop, val) {
18 18 var style = el.style;
  19 + var matched;
19 20
20 21 //IE opacity
21 22 if(prop === 'opacity') {
@@ -33,7 +34,7 @@
33 34
34 35 //Fast pre check
35 36 if(val.indexOf('hsl') > -1) {
36   - var matched = false;
  37 + matched = false;
37 38
38 39 //Replace hsl(a) with hex if needed (ignoring alpha).
39 40 val = val.replace(rxHSLAColor, function(x, h, s, l) {
@@ -51,7 +52,7 @@
51 52
52 53 //Fast pre check
53 54 if(val.indexOf('rgb') > -1) {
54   - var matched = false;
  55 + matched = false;
55 56
56 57 //Replace rgba with hex if needed (ignoring alpha).
57 58 val = val.replace(rxRGBAColor, function(s, r, g, b) {
@@ -88,16 +89,16 @@
88 89 //Based on https://gist.github.com/1325937 and https://gist.github.com/983535
89 90 hsl: function(a,b,c,y){
90 91 a%=360;
91   - a/=60;c/=100;b=[c+=b*=(c<.5?c:1-c)/100,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];
  92 + a/=60;c/=100;b=[c+=b*=(c<0.5?c:1-c)/100,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];
92 93
93 94 y = [b[~~a%6],b[(a|16)%6],b[(a|8)%6]];
94 95
95   - return toHex.rgb(parseInt(y[0] * 255), parseInt(y[1] * 255), parseInt(y[2] * 255));
  96 + return toHex.rgb(parseInt(y[0] * 255, 10), parseInt(y[1] * 255, 10), parseInt(y[2] * 255, 10));
96 97 },
97 98 //https://gist.github.com/983535
98 99 rgb: function(a,b,c){
99 100 return'#' + ((256+a<<8|b)<<8|c).toString(16).slice(1);
100 101 }
101   - }
  102 + };
102 103
103 104 }(window.skrollr));

0 comments on commit 6f0ec00

Please sign in to comment.
Something went wrong with that request. Please try again.