File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -141,8 +141,9 @@ function mergeAttrs (from, to) {
141141 if ( ! to . hasAttribute ( name ) && ! specialCharRE . test ( name ) ) {
142142 to . setAttribute ( name , value )
143143 } else if ( name === 'class' ) {
144- value = to . getAttribute ( name ) + ' ' + value
145- to . setAttribute ( name , value )
144+ value . split ( / \s + / ) . forEach ( function ( cls ) {
145+ _ . addClass ( to , cls )
146+ } )
146147 }
147148 }
148149}
Original file line number Diff line number Diff line change @@ -112,13 +112,13 @@ if (_.inBrowser) {
112112 } )
113113
114114 it ( 'replacer attr should overwrite container attr of same name, except class should be merged' , function ( ) {
115- el . setAttribute ( 'class' , 'test' )
115+ el . setAttribute ( 'class' , 'test other ' )
116116 el . setAttribute ( 'title' , 'parent' )
117- options . template = '<div class="other" title="child"></div>'
117+ options . template = '<div class="other ok " title="child"></div>'
118118 options . replace = true
119119 options . _asComponent = true
120120 var res = transclude ( el , options )
121- expect ( res . getAttribute ( 'class' ) ) . toBe ( 'other test' )
121+ expect ( res . getAttribute ( 'class' ) ) . toBe ( 'other ok test' )
122122 expect ( res . getAttribute ( 'title' ) ) . toBe ( 'child' )
123123 } )
124124
You can’t perform that action at this time.
0 commit comments