mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
code quality
This commit is contained in:
@@ -70,7 +70,7 @@ export default {
|
||||
if (this.widgets[wid].id == k) {
|
||||
payload[k] = ObjectUtils.mergeDeep(this.widgets[wid], payload[k]);
|
||||
// NOTE(chris): remove internal props
|
||||
for (var prop of ['_x','_y','_w','_h','index','id','preset'])
|
||||
for (var prop of ['_x', '_y', '_w', '_h', 'index', 'id', 'preset'])
|
||||
if (payload[k][prop])
|
||||
delete payload[k][prop];
|
||||
break;
|
||||
|
||||
@@ -146,26 +146,26 @@ export default {
|
||||
|
||||
let item = {...update.item};
|
||||
if (!item.placeholder) {
|
||||
if (!item.place[this.gridWidth])
|
||||
item.place[this.gridWidth] = {x: 0, y: 0, w: 1, h: 1};
|
||||
delete item.x;
|
||||
delete item.y;
|
||||
delete item.w;
|
||||
delete item.h;
|
||||
delete item.place[this.gridWidth].pinned;
|
||||
if (update.x !== undefined)
|
||||
item.place[this.gridWidth].x = update.x;
|
||||
if (update.y !== undefined)
|
||||
item.place[this.gridWidth].y = update.y;
|
||||
if (update.w !== undefined)
|
||||
item.place[this.gridWidth].w = update.w;
|
||||
if (update.h !== undefined)
|
||||
item.place[this.gridWidth].h = update.h;
|
||||
if (pinned){
|
||||
item.place[this.gridWidth].pinned = true;
|
||||
}
|
||||
if (!item.place[this.gridWidth])
|
||||
item.place[this.gridWidth] = {x: 0, y: 0, w: 1, h: 1};
|
||||
delete item.x;
|
||||
delete item.y;
|
||||
delete item.w;
|
||||
delete item.h;
|
||||
delete item.place[this.gridWidth].pinned;
|
||||
if (update.x !== undefined)
|
||||
item.place[this.gridWidth].x = update.x;
|
||||
if (update.y !== undefined)
|
||||
item.place[this.gridWidth].y = update.y;
|
||||
if (update.w !== undefined)
|
||||
item.place[this.gridWidth].w = update.w;
|
||||
if (update.h !== undefined)
|
||||
item.place[this.gridWidth].h = update.h;
|
||||
if (pinned) {
|
||||
item.place[this.gridWidth].pinned = true;
|
||||
}
|
||||
|
||||
result[item.id] = item;
|
||||
result[item.id] = item;
|
||||
}
|
||||
});
|
||||
this.updatePreset(result);
|
||||
|
||||
Reference in New Issue
Block a user