summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/submit-cancel.js5
-rw-r--r--assets/js/components/task-move-position.js18
2 files changed, 20 insertions, 3 deletions
diff --git a/assets/js/components/submit-cancel.js b/assets/js/components/submit-cancel.js
index 1950c060..061b1146 100644
--- a/assets/js/components/submit-cancel.js
+++ b/assets/js/components/submit-cancel.js
@@ -26,5 +26,10 @@ Vue.component('submit-cancel', {
onCancel: function () {
_KB.get('Popover').close();
}
+ },
+ events: {
+ 'submitCancelled': function() {
+ this.loading = false;
+ }
}
});
diff --git a/assets/js/components/task-move-position.js b/assets/js/components/task-move-position.js
index 390dcff1..11e1068c 100644
--- a/assets/js/components/task-move-position.js
+++ b/assets/js/components/task-move-position.js
@@ -8,13 +8,15 @@ Vue.component('task-move-position', {
position: 1,
columns: [],
tasks: [],
- positionChoice: 'before'
+ positionChoice: 'before',
+ errorMessage: ''
}
},
ready: function () {
this.columns = this.board[0].columns;
this.columnId = this.columns[0].id;
this.tasks = this.columns[0].tasks;
+ this.errorMessage = '';
},
methods: {
onChangeSwimlane: function () {
@@ -50,6 +52,8 @@ Vue.component('task-move-position', {
});
},
onSubmit: function () {
+ var self = this;
+
if (this.positionChoice == 'after') {
this.position++;
}
@@ -65,8 +69,16 @@ Vue.component('task-move-position', {
"swimlane_id": this.swimlaneId,
"position": this.position
}),
- complete: function() {
- window.location.reload(true);
+ statusCode: {
+ 200: function() {
+ window.location.reload(true);
+ },
+ 403: function(jqXHR) {
+ var response = JSON.parse(jqXHR.responseText);
+ self.errorMessage = response.message;
+
+ self.$broadcast('submitCancelled');
+ }
}
});
}