summaryrefslogtreecommitdiffstats
path: root/web/js/labitrack.d/41-create.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/labitrack.d/41-create.js')
-rw-r--r--web/js/labitrack.d/41-create.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/web/js/labitrack.d/41-create.js b/web/js/labitrack.d/41-create.js
index ec689c4..4a1f37f 100644
--- a/web/js/labitrack.d/41-create.js
+++ b/web/js/labitrack.d/41-create.js
@@ -1,11 +1,18 @@
(function(){
- function on_submit(label, o) {
+ function on_submit(label, o, print) {
o.save(undef, {
success: function(){
label.set_data(o.toJSON());
- label.print();
+ if (print) {
+ label.print();
+ }
+ var id = o.get('id');
console.log('Saved with id: ' + o.get('id'));
+ λ.alert('newlabel', {id: o.get('id')});
+
+ o.set('id', undefined);
+ label.trigger_refresh();
}
});
}