This repository was archived by the owner on Jan 24, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change 3030 return " " + $1 . toLowerCase ( ) ;
3131 } ) ;
3232 var tokens = dashed . split ( ' ' ) ;
33- var ns = tokens [ 0 ] ;
34- var dirname = tokens . slice ( 1 ) . join ( '-' ) ;
35-
36- // this is finite list and it seemed senseless to create a custom method
37- result . push ( ns + ":" + dirname ) ;
38- result . push ( ns + "-" + dirname ) ;
39- result . push ( "x-" + ns + "-" + dirname ) ;
40- result . push ( "data-" + ns + "-" + dirname ) ;
33+
34+ // If a token is just a single name (i.e. no namespace) then we juse define the elements the name given
35+ if ( tokens . length === 1 ) {
36+ var name = tokens [ 0 ] ;
37+
38+ result . push ( name ) ;
39+ result . push ( "x-" + name ) ;
40+ result . push ( "data-" + name ) ;
41+ } else {
42+ var ns = tokens [ 0 ] ;
43+ var dirname = tokens . slice ( 1 ) . join ( '-' ) ;
44+
45+ // this is finite list and it seemed senseless to create a custom method
46+ result . push ( ns + ":" + dirname ) ;
47+ result . push ( ns + "-" + dirname ) ;
48+ result . push ( "x-" + ns + "-" + dirname ) ;
49+ result . push ( "data-" + ns + "-" + dirname ) ;
50+ }
4151 return result ;
4252 } ;
4353
4959 }
5060 }
5161
52- } ) ( window ) ;
62+ } ) ( window ) ;
You can’t perform that action at this time.
0 commit comments