Skip to content

Commit 0ce8eae

Browse files
committed
Fix issue with settings for vertical and horizontal grid being used as strings
1 parent bf4735f commit 0ce8eae

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

extension/PixelParallel.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11037,16 +11037,23 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1103711037

1103811038
computed: {
1103911039
horizontalGridStyles: function horizontalGridStyles() {
11040+
var opacity = this.config.horizontalGrid.opacity;
11041+
var width = parseInt(this.config.horizontalGrid.width) || 0;
11042+
var gutter = parseInt(this.config.horizontalGrid.gutter) || 0;
11043+
1104011044
return {
11041-
'opacity': this.config.horizontalGrid.opacity,
11042-
'border-spacing': this.config.horizontalGrid.gutter + 'px',
11043-
'width': '' + (this.config.horizontalGrid.width ? this.config.horizontalGrid.width + this.config.horizontalGrid.gutter * 2 + 'px' : 'calc(100% + ' + this.config.horizontalGrid.gutter * 2 + 'px)')
11045+
'opacity': opacity,
11046+
'border-spacing': gutter + 'px',
11047+
'width': '' + (width ? width + gutter * 2 + 'px' : 'calc(100% + ' + gutter * 2 + 'px)')
1104411048
};
1104511049
},
1104611050
verticalGridStyles: function verticalGridStyles() {
11051+
var opacity = this.config.verticalGrid.opacity;
11052+
var gutter = parseInt(this.config.verticalGrid.gutter) || 0;
11053+
1104711054
return {
11048-
'opacity': this.config.verticalGrid.opacity,
11049-
'background-size': '100% ' + this.config.verticalGrid.gutter + 'px'
11055+
'opacity': opacity,
11056+
'background-size': '100% ' + gutter + 'px'
1105011057
};
1105111058
}
1105211059
}
@@ -28154,7 +28161,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
2815428161
'pixelParallel-grid-horizontal-enabled': _vm.config.horizontalGrid.enabled
2815528162
}],
2815628163
style: (_vm.horizontalGridStyles)
28157-
}, _vm._l((_vm.config.horizontalGrid.columns), function(val) {
28164+
}, _vm._l(((parseInt(_vm.config.horizontalGrid.columns) || 1)), function(val) {
2815828165
return _c('span')
2815928166
})), _vm._v(" "), _c('div', {
2816028167
class: ['pixelParallel-grid-vertical', {

src/components/OverlayGrids.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="pixelParallel-grids">
33
<div :class="['pixelParallel-grid-horizontal', {'pixelParallel-grid-horizontal-enabled': config.horizontalGrid.enabled}]" :style="horizontalGridStyles">
4-
<span v-for="val in config.horizontalGrid.columns" />
4+
<span v-for="val in (parseInt(config.horizontalGrid.columns) || 1)" />
55
</div>
66

77
<div :class="['pixelParallel-grid-vertical', {'pixelParallel-grid-vertical-enabled': config.verticalGrid.enabled}]" :style="verticalGridStyles"></div>
@@ -17,16 +17,23 @@ export default {
1717
1818
computed: {
1919
horizontalGridStyles () {
20+
const opacity = this.config.horizontalGrid.opacity;
21+
const width = parseInt(this.config.horizontalGrid.width) || 0;
22+
const gutter = parseInt(this.config.horizontalGrid.gutter) || 0;
23+
2024
return {
21-
'opacity': this.config.horizontalGrid.opacity,
22-
'border-spacing': `${this.config.horizontalGrid.gutter}px`,
23-
'width': `${this.config.horizontalGrid.width ? `${this.config.horizontalGrid.width + this.config.horizontalGrid.gutter * 2}px` : `calc(100% + ${this.config.horizontalGrid.gutter * 2}px)`}`
25+
'opacity': opacity,
26+
'border-spacing': `${gutter}px`,
27+
'width': `${width ? `${width + gutter * 2}px` : `calc(100% + ${gutter * 2}px)`}`
2428
};
2529
},
2630
verticalGridStyles() {
31+
const opacity = this.config.verticalGrid.opacity;
32+
const gutter = parseInt(this.config.verticalGrid.gutter) || 0;
33+
2734
return {
28-
'opacity': this.config.verticalGrid.opacity,
29-
'background-size': `100% ${this.config.verticalGrid.gutter}px`
35+
'opacity': opacity,
36+
'background-size': `100% ${gutter}px`
3037
}
3138
}
3239
}

0 commit comments

Comments
 (0)