From 71d85fccfff7c9241684a309719c15472749c2d7 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Mon, 12 Oct 2015 11:36:25 -0400 Subject: [PATCH] Finally update dialogue for pasting an image larger than the canvas I feel like this was the window that most drove me to improve the accessibility of the windows, but I somehow missed it. --- src/functions.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/functions.js b/src/functions.js index a9ffa6d..1781993 100644 --- a/src/functions.js +++ b/src/functions.js @@ -239,13 +239,14 @@ function paste_from(){ function paste(img){ if(img.width > canvas.width || img.height > canvas.height){ - var $w = new $Window(); + var $w = new $FormWindow().addClass("jspaint-dialogue-window"); $w.title("Paint"); - $w.$content.html( + $w.$main.html( "The image is bigger than the canvas.
" + "Would you like the canvas to be enlarged?
" ); $w.$Button("Enlarge", function(){ + $w.close(); // Additional undoable undoable(function(){ var original = undos[undos.length-1]; @@ -261,9 +262,12 @@ function paste(img){ }); }).focus(); $w.$Button("Crop", function(){ + $w.close(); paste_img(); }); - $w.$Button("Cancel", function(){}); + $w.$Button("Cancel", function(){ + $w.close(); + }); $w.center(); }else{ paste_img();