Prevent setting a bucket limit < 0
This commit is contained in:
parent
03d60d3f11
commit
48fb707032
1 changed files with 13 additions and 3 deletions
|
@ -51,16 +51,18 @@
|
||||||
<div class="field has-addons" v-if="showSetLimitInput">
|
<div class="field has-addons" v-if="showSetLimitInput">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input
|
<input
|
||||||
@change="() => updateBucket(bucket)"
|
@change="() => setBucketLimit(bucket)"
|
||||||
@keyup.enter="() => updateBucket(bucket)"
|
@keyup.enter="() => setBucketLimit(bucket)"
|
||||||
class="input"
|
class="input"
|
||||||
type="number"
|
type="number"
|
||||||
|
min="0"
|
||||||
v-focus.always
|
v-focus.always
|
||||||
v-model="bucket.limit"
|
v-model="bucket.limit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<x-button
|
<x-button
|
||||||
|
:disabled="bucket.limit < 0"
|
||||||
:icon="['far', 'save']"
|
:icon="['far', 'save']"
|
||||||
:shadow="false"
|
:shadow="false"
|
||||||
/>
|
/>
|
||||||
|
@ -75,7 +77,8 @@
|
||||||
class="dropdown-item"
|
class="dropdown-item"
|
||||||
v-tooltip="'All tasks moved into the done bucket will be marked as done automatically. All tasks marked as done from elsewhere will be moved as well.'"
|
v-tooltip="'All tasks moved into the done bucket will be marked as done automatically. All tasks marked as done from elsewhere will be moved as well.'"
|
||||||
>
|
>
|
||||||
<span class="icon is-small" :class="{'has-text-success': bucket.isDoneBucket}"><icon icon="check-double"/></span>
|
<span class="icon is-small" :class="{'has-text-success': bucket.isDoneBucket}"><icon
|
||||||
|
icon="check-double"/></span>
|
||||||
Done bucket
|
Done bucket
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
|
@ -601,6 +604,13 @@ export default {
|
||||||
this.error(e, this)
|
this.error(e, this)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
setBucketLimit(bucket) {
|
||||||
|
if (bucket.limit < 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateBucket(bucket)
|
||||||
|
},
|
||||||
shouldAcceptDrop(bucket) {
|
shouldAcceptDrop(bucket) {
|
||||||
return bucket.id === this.sourceBucket || // When dragging from a bucket who has its limit reached, dragging should still be possible
|
return bucket.id === this.sourceBucket || // When dragging from a bucket who has its limit reached, dragging should still be possible
|
||||||
bucket.limit === 0 || // If there is no limit set, dragging & dropping should always work
|
bucket.limit === 0 || // If there is no limit set, dragging & dropping should always work
|
||||||
|
|
Loading…
Reference in a new issue