diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 8bb5e7958..94b3621d6 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -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; diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index d312107e9..79780d63c 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -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);