diff options
| author | Lex Neva <github.com@lexneva.name> | 2019-04-12 17:45:57 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2019-04-12 17:57:07 -0400 |
| commit | 9b2a47136b34a4b9cfcc42282a39fdd909e9f8af (patch) | |
| tree | 67edbda61bb5b72afac0c1bf26836f7feda43a48 /print/resources | |
| parent | 785e3798c46a00ccbde89c0aeee95140dfbe6d92 (diff) | |
enable print button
Diffstat (limited to 'print/resources')
| -rw-r--r-- | print/resources/inkstitch.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/print/resources/inkstitch.js b/print/resources/inkstitch.js index c58aed8a..32a9a207 100644 --- a/print/resources/inkstitch.js +++ b/print/resources/inkstitch.js @@ -1,3 +1,5 @@ +var electron = require('electron'); + $.postJSON = function(url, data, success=null) { return $.ajax(url, { type: 'POST', @@ -366,13 +368,8 @@ $(function() { }); $('button.print').click(function() { - // printing halts all javascript activity, so we need to tell the backend - // not to shut down until we're done. - $.get("/printing/start") - .done(function() { - window.print(); - $.get("/printing/end"); - }); + var pageSize = $('select#printing-size').find(':selected').text(); + electron.ipcRenderer.send('print', pageSize) }); $('button.settings').click(function(){ |
