From cb453b068de91e585e739e6bca1b2969c7af8611 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 Oct 2015 23:56:01 -0700 Subject: [PATCH] Convert QR.oekaki.draw to $.global. --- src/Posting/QR.oekaki.coffee | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Posting/QR.oekaki.coffee b/src/Posting/QR.oekaki.coffee index c26f23c4b..6a1e5b9dc 100644 --- a/src/Posting/QR.oekaki.coffee +++ b/src/Posting/QR.oekaki.coffee @@ -1,19 +1,16 @@ QR.oekaki = draw: -> - $.globalEval ''' - Tegaki.open({ - onDone: function() { - Tegaki.flatten().toBlob(function (blob) { - var detail = {file: blob, name: 'tegaki.png'}; - var event = new CustomEvent('QRSetFile', {bubbles: true, detail: detail}); - document.dispatchEvent(event); - }); - }, - onCancel: function() {}, - width: +document.querySelector('#qr [name=oekaki-width]').value, + $.global -> + {Tegaki} = window + Tegaki.open + onDone: -> + Tegaki.flatten().toBlob (file) -> + document.dispatchEvent new CustomEvent 'QRSetFile', + bubbles: true + detail: {file, name: 'tegaki.png'} + onCancel: -> + width: +document.querySelector('#qr [name=oekaki-width]').value height: +document.querySelector('#qr [name=oekaki-height]').value - }); - ''' edit: -> $.global ->