Commit fed9eb4b authored by Kent Nielsen's avatar Kent Nielsen
Browse files

Imporving performance of resize

parent e9a27dab
......@@ -41,7 +41,8 @@ export default {
],
mouseDragPos: {x: 0, y: 0},
verticalResizeObject: {index: 0},
horizontalResizeObject: {row: 0, col: 0}
horizontalResizeObject: {row: 0, col: 0},
prevWinWidth: 0
}
},
......@@ -127,6 +128,12 @@ export default {
mobileLayoutResize(){
const winWidth = window.innerWidth;
if((this.prevWinWidth - 992) > 0 && (winWidth - 992) > 0){
return;
}
if((this.prevWinWidth - 992) < 0 && (winWidth - 992) < 0){
return;
}
const rows = document.getElementsByClassName("row");
for (let i = 0; i < rows.length; i++) {
......@@ -145,11 +152,13 @@ export default {
}else{
row.style.height = this.layout[i].height + 'px';
}
}
}
this.prevWinWidth = winWidth;
}
},
mounted(){
this.prevWinWidth = window.innerWidth;
this.mobileLayoutResize();
window.addEventListener('resize', this.mobileLayoutResize);
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment