File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1+ module . exports = {
2+
3+ _value : false ,
4+
5+ /**
6+ * Sets handler value.
7+ *
8+ * @param {String|Number|Boolean } value Option value
9+ * @returns {Object }
10+ */
11+ setValue : function ( value ) {
12+ if ( ! value ) return this ;
13+ if ( value === true ) value = ' ' ; // 1 space by default
14+ if ( typeof value === 'number' ) this . _value = new Array ( Math . round ( value ) + 1 ) . join ( ' ' ) ;
15+ if ( typeof value === 'string' && value . match ( / ^ [ \t \n ] * $ / ) ) this . _value = value ;
16+ return this ;
17+ } ,
18+
19+ /**
20+ * Processes tree node.
21+ * @param {String } nodeType
22+ * @param {node } node
23+ */
24+ process : function ( nodeType , node ) {
25+ if ( nodeType === 'simpleselector' ) {
26+ if ( node [ node . length - 1 ] [ 0 ] === 's' ) node . pop ( ) ;
27+ node . push ( [ 's' , this . _value ] ) ;
28+ }
29+ }
30+
31+ } ;
Original file line number Diff line number Diff line change 4646
4747 a {
4848top : 0 ;/* ololo */ margin : 0 ;}
49- b {
49+ b
50+ {
5051top : 0 /* trololo */ ;margin : 0 ;}
5152
5253
You can’t perform that action at this time.
0 commit comments