Skip to content

Commit 5829779

Browse files
authored
Update App.vue
1 parent e267182 commit 5829779

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/App.vue

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
:min-w="2"
3535
:min-h="2"
3636
:i="item.i"
37-
@resized="resized"
38-
@moved="moved">
37+
@resize="resize"
38+
@move="move">
3939
<test-element :text="item.i"></test-element>
4040
</grid-item>
4141
</grid-layout>
@@ -113,12 +113,29 @@
113113
this.index++;
114114
this.layout.push(item);
115115
},
116-
moved: function(i, newX, newY){
116+
move: function(i, newX, newY){
117117
console.log(i, newX, newY)
118118
},
119-
resized: function(i, newH, newW){
119+
resize: function(i, newH, newW){
120120
console.log(i, newH, newW)
121121
}
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+
}
122139
},
123140
}
124141
</script>

0 commit comments

Comments
 (0)