Fix: show notification and clear input field after adding a model
This commit is contained in:
parent
41ffd75d48
commit
98aa9bc148
|
@ -305,7 +305,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let ctbrec = {
|
let ctbrec = {
|
||||||
add: function(input, onsuccess) {
|
add: function(input, duration, onsuccess) {
|
||||||
try {
|
try {
|
||||||
let model = {
|
let model = {
|
||||||
type: null,
|
type: null,
|
||||||
|
@ -326,8 +326,11 @@
|
||||||
data: msg
|
data: msg
|
||||||
})
|
})
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
|
console.log(data);
|
||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
|
if (onsuccess) {
|
||||||
onsuccess.call(data);
|
onsuccess.call(data);
|
||||||
|
}
|
||||||
$.notify('Model added', 'info');
|
$.notify('Model added', 'info');
|
||||||
} else {
|
} else {
|
||||||
$.notify('Adding model failed', 'error');
|
$.notify('Adding model failed', 'error');
|
||||||
|
|
Loading…
Reference in New Issue