Skip to content

Commit

Permalink
fix: remove function and use fat arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Sep 15, 2020
1 parent 64a1009 commit ee7b569
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/components/GridLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
watch: {
width(newval, oldval) {
const t = this;
t.$nextTick(function () {
t.$nextTick(() => {
//t.$broadcast("updateWidth", t.width);
t.eventBus.$emit('updateWidth', t.width);
if (oldval === null) {
Expand Down Expand Up @@ -205,10 +205,10 @@
created() {
const t = this;
// Accessible refernces of functions for removing in beforeDestroy
t.resizeEventHandler = function (eventType, i, x, y, h, w) {
t.resizeEventHandler = (eventType, i, x, y, h, w) => {
t.resizeEvent(eventType, i, x, y, h, w);
};
t.dragEventHandler = function (eventType, i, x, y, h, w) {
t.dragEventHandler = (eventType, i, x, y, h, w) => {
t.dragEvent(eventType, i, x, y, h, w);
};
t._provided.eventBus = new Vue();
Expand All @@ -222,25 +222,25 @@
},
mounted() {
this.$emit('layout-mounted', this.layout);
this.$nextTick(function () {
this.$nextTick(() => {
validateLayout(this.layout);
this.originalLayout = this.layout;
const t = this;
this.$nextTick(function () {
this.$nextTick(() => {
t.onWindowResize();
t.initResponsiveFeatures();
//t.width = t.$el.offsetWidth;
addWindowEventListener('resize', t.onWindowResize);
compact(t.layout, t.verticalCompact);
t.$emit('layout-updated', t.layout);
t.updateHeight();
t.$nextTick(function () {
t.$nextTick(() => {
this.erd = elementResizeDetectorMaker({
strategy: 'scroll', //<- For ultra performance.
// See https://github.com/wnr/element-resize-detector/issues/110 about callOnAdd.
callOnAdd: false,
});
this.erd.listenTo(t.$refs.gridLayout, function () {
t.erd.listenTo(t.$refs.gridLayout, () => {
t.onWindowResize();
});
});
Expand Down Expand Up @@ -324,13 +324,13 @@
this.placeholder.y = l.y;
this.placeholder.w = w;
this.placeholder.h = h;
this.$nextTick(function () {
this.$nextTick(() => {
this.isDragging = true;
});
//this.$broadcast("updateWidth", this.width);
this.eventBus.$emit('updateWidth', this.width);
} else {
this.$nextTick(function () {
this.$nextTick(() => {
this.isDragging = false;
});
}
Expand Down Expand Up @@ -393,13 +393,13 @@
this.placeholder.y = y;
this.placeholder.w = l.w;
this.placeholder.h = l.h;
this.$nextTick(function () {
this.$nextTick(() => {
this.isDragging = true;
});
//this.$broadcast("updateWidth", this.width);
this.eventBus.$emit('updateWidth', this.width);
} else {
this.$nextTick(function () {
this.$nextTick(() => {
this.isDragging = false;
});
}
Expand Down Expand Up @@ -460,15 +460,15 @@
// find difference in layouts
findDifference(layout, originalLayout) {
//Find values that are in result1 but not in result2
let uniqueResultOne = layout.filter(function (obj) {
return !originalLayout.some(function (obj2) {
let uniqueResultOne = layout.filter((obj) => {
return !originalLayout.some((obj2) => {
return obj.i === obj2.i;
});
});
//Find values that are in result2 but not in result1
let uniqueResultTwo = originalLayout.filter(function (obj) {
return !layout.some(function (obj2) {
let uniqueResultTwo = originalLayout.filter((obj) => {
return !layout.some((obj2) => {
return obj.i === obj2.i;
});
});
Expand Down

0 comments on commit ee7b569

Please sign in to comment.