Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
GopherJ committed May 4, 2018
1 parent c44fa6a commit 5170e12
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/components/LayoutGrid/LayoutGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<div class="level-item">
<span class="icon">
<i class="mdi mdi-pencil mdi-18px" @click="$emit('edit', l.i)"></i>
<i class="mdi mdi-pencil mdi-18px" @click="onEdit(l.i)"></i>
</span>
</div>

Expand Down Expand Up @@ -89,7 +89,7 @@
<script>
/* eslint-disable */
import VueGridLayout from 'vue-grid-layout';
import {mapMutations, mapState, mapGetters} from 'vuex';
import {mapMutations, mapState} from 'vuex';
import Emotion from './Emotion';
export default {
Expand Down Expand Up @@ -128,22 +128,33 @@
'EXPAND_LAYOUT_ITEM',
'DELETE_LAYOUT_ITEM',
'COLLAPSE_LAYOUT_ITEM',
'SET_LAYOUT'
]),
onResize(i, h, w) {
this.$emit('resize', i, h, w);
this.$refs[this.GetRef(i)][0].safeDraw();
if (this.$refs[this.GetRef(i)][0].safeDraw) {
this.$refs[this.GetRef(i)][0].safeDraw();
}
},
onResized(i, h, w, hpx, wpx) {
this.$emit('resized', i, h, w, hpx, wpx);
this.$refs[this.GetRef(i)][0].safeDraw();
if (this.$refs[this.GetRef(i)][0].safeDraw) {
this.$refs[this.GetRef(i)][0].safeDraw();
}
},
onLayoutUpdated(n) {
this.$emit('updated', n);
this.SET_LAYOUT(n);
},
onEdit(i) {
this.$emit('edit', i);
if (this.$root) {
this.$root.$emit('layout-item-edit', {
i,
payload: null
});
}
}
},
computed: {
Expand Down

0 comments on commit 5170e12

Please sign in to comment.