File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Original file line number Diff line number Diff line change @@ -168,17 +168,20 @@ export function off (el, event, cb) {
168
168
* In IE9, setAttribute('class') will result in empty class
169
169
* if the element also has the :class attribute; However in
170
170
* PhantomJS, setting `className` does not work on SVG elements...
171
- * So we have to do a conditional detection here.
171
+ * So we have to do a conditional check here.
172
+ *
173
+ * @param {Element } el
174
+ * @param {String } cls
172
175
*/
173
176
174
- const setClass = isIE9
175
- ? function ( el , cls ) {
176
- /* istanbul ignore next */
177
+ function setClass ( el , cls ) {
178
+ /* istanbul ignore if */
179
+ if ( isIE9 && el . hasOwnProperty ( 'className' ) ) {
177
180
el . className = cls
178
- }
179
- : function ( el , cls ) {
181
+ } else {
180
182
el . setAttribute ( 'class' , cls )
181
183
}
184
+ }
182
185
183
186
/**
184
187
* Add class with compatibility for IE & SVG
You can’t perform that action at this time.
0 commit comments