File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1+
12/**
23 * @file Direction-free CSS
34 * @author Mahdi NezaratiZadeh <mahdi.nezarati@gmail.com>
@@ -139,14 +140,15 @@ window.MyCSS = {
139140 _addToStyleSheet ( selector , declaration )
140141 {
141142 let stylesheet = this . _stylesheet ;
143+ let index = stylesheet . rules . length ;
142144 if ( stylesheet . insertRule ) {
143145 var inner_code = `${ selector } {
144146 ${ declaration }
145147 }` ;
146148 //console.log(inner_code);
147- return stylesheet . insertRule ( inner_code , stylesheet . rules . length ) ;
149+ return stylesheet . insertRule ( inner_code , index ) ;
148150 } else if ( stylesheet . addRule ) {
149- return stylesheet . addRule ( stylesheet , declaration ) ;
151+ return stylesheet . addRule ( selector , declaration , index ) ;
150152 } else {
151153 throw new Error ( 'X_0' ) ;
152154 }
You can’t perform that action at this time.
0 commit comments