Changed the element.find(className) to findDivByClassName = function(element, className)
Changed angular.element('body') to angular.element($document).find('body')
Changed $slider.width() to $slider[0].offsetWidth (and same with height)
I tested it in Chrome and FF and it works. I can't test it under IE because I'm using Linux. But offsetWidth is IE compatible.
Regarding findDivByClassName, I first used getElementsByClassName but it appeard not to be IE8 compatible so I went for a custom method, that only uses angular.find(tagName) which must be based on getElementsByTagName which is IE8 compatible.
Here it is:
var filter = function(array, method) {
var filteredArray = [];
for (var i=0; i<array.length; i++) {
if (method(array[i])) {
filteredArray.push(array[i])
}
}
return filteredArray;
};
var findDivByClassName = function(element, className) {
return angular.element(filter(element.find('div'), function(el){
return angular.element(el).hasClass(className);
}));
};
I can see there is another pull request on the same topic: https://github.com/danielcrisp/angular-rangeslider/pull/21
Changes here are really small:
element.find(className)
tofindDivByClassName = function(element, className)
angular.element('body')
toangular.element($document).find('body')
$slider.width()
to$slider[0].offsetWidth
(and same with height)I tested it in Chrome and FF and it works. I can't test it under IE because I'm using Linux. But
offsetWidth
is IE compatible.Regarding
findDivByClassName
, I first usedgetElementsByClassName
but it appeard not to be IE8 compatible so I went for a custom method, that only usesangular.find(tagName)
which must be based ongetElementsByTagName
which is IE8 compatible.Here it is:
Hope this gets merged soon! :smile:
Awesome directive by the way!