forked from j62/ctbrec
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 = {
|
||||
add: function(input, onsuccess) {
|
||||
add: function(input, duration, onsuccess) {
|
||||
try {
|
||||
let model = {
|
||||
type: null,
|
||||
|
@ -326,8 +326,11 @@
|
|||
data: msg
|
||||
})
|
||||
.done(function(data) {
|
||||
console.log(data);
|
||||
if (data.status === 'success') {
|
||||
if (onsuccess) {
|
||||
onsuccess.call(data);
|
||||
}
|
||||
$.notify('Model added', 'info');
|
||||
} else {
|
||||
$.notify('Adding model failed', 'error');
|
||||
|
|
Loading…
Reference in New Issue