Skip to content

Commit 67788f0

Browse files
authored
Merge pull request jbaysolutions#272 from panjiangyi/staticSupport
Add support for static elements
2 parents 763d41b + 9b74805 commit 67788f0

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

dist/js/app.ba023a5a.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/app.ba023a5a.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/chunk-vendors.ea17aa36.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/chunk-vendors.ea17aa36.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/GridItem.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div ref="item"
33
class="vue-grid-item"
4-
:class="{ 'vue-resizable' : resizable, 'resizing' : isResizing, 'vue-draggable-dragging' : isDragging, 'cssTransforms' : useCssTransforms, 'render-rtl' : renderRtl, 'disable-userselect': isDragging, 'no-touch': isAndroid }"
4+
:class="{ 'vue-resizable' : showResizeIcon,'vue-unresizable' : !showResizeIcon, 'resizing' : isResizing, 'vue-draggable-dragging' : isDragging, 'cssTransforms' : useCssTransforms, 'render-rtl' : renderRtl, 'disable-userselect': isDragging, 'no-touch': isAndroid }"
55
:style="style"
66
>
77
<slot></slot>
@@ -131,12 +131,12 @@
131131
type: Boolean,
132132
required: true
133133
},
134-
static: {
134+
*/
135+
static: {
135136
type: Boolean,
136137
required: false,
137138
default: false
138139
},
139-
*/
140140
minH: {
141141
type: Number,
142142
required: false,
@@ -374,6 +374,9 @@
374374
}
375375
},
376376
computed: {
377+
showResizeIcon(){
378+
return this.resizable&&!this.static
379+
},
377380
isAndroid() {
378381
return navigator.userAgent.toLowerCase().indexOf("android") !== -1;
379382
},
@@ -436,6 +439,7 @@
436439
437440
},
438441
handleResize: function (event) {
442+
if (this.static) return;
439443
const position = getControlPosition(event);
440444
// Get the current drag point from the event. This is used as the offset.
441445
if (position == null) return; // not possible but satisfies flow
@@ -514,6 +518,7 @@
514518
this.eventBus.$emit("resizeEvent", event.type, this.i, this.innerX, this.innerY, pos.h, pos.w);
515519
},
516520
handleDrag(event) {
521+
if (this.static) return;
517522
if (this.isResizing) return;
518523
519524
const position = getControlPosition(event);

0 commit comments

Comments
 (0)