File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 34
34
:min-w =" 2"
35
35
:min-h =" 2"
36
36
:i =" item.i"
37
- @resized = " resized "
38
- @moved = " moved " >
37
+ @resize = " resize "
38
+ @move = " move " >
39
39
<test-element :text =" item.i" ></test-element >
40
40
</grid-item >
41
41
</grid-layout >
113
113
this .index ++ ;
114
114
this .layout .push (item);
115
115
},
116
- moved : function (i , newX , newY ){
116
+ move : function (i , newX , newY ){
117
117
console .log (i, newX, newY)
118
118
},
119
- resized : function (i , newH , newW ){
119
+ resize : function (i , newH , newW ){
120
120
console .log (i, newH, newW)
121
121
}
122
+ /**
123
+ * Add change direction button
124
+ */
125
+ changeDirection () {
126
+ let documentDirection = (document .dir != undefined ) ?
127
+ document .dir :
128
+ document .getElementsByTagName (" html" )[0 ].getAttribute (" dir" );
129
+ let toggle = " " ;
130
+ if (documentDirection == " rtl" ) {
131
+ toggle = " ltr"
132
+ } else {
133
+ toggle = " rtl"
134
+ }
135
+ var html = document .getElementsByTagName (" html" )[0 ];
136
+ html .setAttribute (" dir" , toggle);
137
+ eventBus .$emit (' directionchange' );
138
+ }
122
139
},
123
140
}
124
141
</script >
You can’t perform that action at this time.
0 commit comments