angularjs-breakpoint icon indicating copy to clipboard operation
angularjs-breakpoint copied to clipboard

Reserved word "class" breaks ie8 usage

Open ichabodcole opened this issue 10 years ago • 1 comments

FYI, "class" is a reserved word in ie8 so breakpoint.class causes an error. It's easy to get around this by using breakpoint['class'], but might be good to point this out in the "Events" portion of the docs to avoid tears. The library also breaks in ie8 because of this issue when pulling in through bower though, so I would suggest using the above work around or not using the word class in the library. (If you want to support ie8 that is, which I can understand if you don't)

ichabodcole avatar Mar 31 '15 18:03 ichabodcole

To support IE8:

Change 'class' to 'klass' in applicable areas and then:

scope.breakpoint.windowSize = $window.innerWidth;

to

scope.breakpoint.windowSize = $window.innerWidth || $document[0].documentElement.clientWidth || $document[0].body.clientWidth;

Since IE8 does not have innerWidth.

jchaney01 avatar Apr 01 '15 21:04 jchaney01