From 5e54ba7aa27b95d1e0568693915e735ab8058ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Thu, 28 Jun 2012 19:49:45 +0000 Subject: Initial version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- web/js/labitrack.d/41-create.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 web/js/labitrack.d/41-create.js (limited to 'web/js/labitrack.d/41-create.js') diff --git a/web/js/labitrack.d/41-create.js b/web/js/labitrack.d/41-create.js new file mode 100644 index 0000000..ec689c4 --- /dev/null +++ b/web/js/labitrack.d/41-create.js @@ -0,0 +1,29 @@ +(function(){ + function on_submit(label, o) { + o.save(undef, { + success: function(){ + label.set_data(o.toJSON()); + label.print(); + + console.log('Saved with id: ' + o.get('id')); + } + }); + } + + var view = λ.routableview.extend({ + render: function () { + λ.setcontent('create', { + save_text: 'Save and queue for printing', + data: {}, + tags: λ.tags + }); + var o = new λ.o(); + λ.labelform({ + model: o, + submit: on_submit + }); + } + }); + + view.route('', 'create'); +}()); -- cgit v1.2.1