From 1ebf356aae8c5f18d561f730360c71eb8e776204 Mon Sep 17 00:00:00 2001 From: Lewis Hemens Date: Sun, 23 Mar 2014 12:09:25 +0000 Subject: [PATCH] Made text tool input hide when leaving the tool --- js-compiled.js | 2 ++ js-lib/controller.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/js-compiled.js b/js-compiled.js index 2f97d62..2c96b58 100644 --- a/js-compiled.js +++ b/js-compiled.js @@ -461,6 +461,7 @@ W.prototype.n = function() { A(a.view); }); $("#draw-tools > button.tool").click(function(a) { + $("#text-tool-widget").hide(0); a = a.target.id; $("#draw-tools > button.tool").removeClass("active"); $("#" + a).toggleClass("active"); @@ -471,6 +472,7 @@ W.prototype.n = function() { "erase-button" == a && (this.c = new Q(this.state)); "move-button" == a && (this.c = new R(this.state)); "text-button" == a && (this.c = new P(this.state)); + L(this.state); this.view.canvas.focus(); }.bind(this)); $("#file-tools > button.tool").click(function(a) { diff --git a/js-lib/controller.js b/js-lib/controller.js index a34a3e9..f497d85 100644 --- a/js-lib/controller.js +++ b/js-lib/controller.js @@ -100,6 +100,7 @@ ascii.Controller.prototype.installBindings = function() { $(window).resize(function(e) { controller.view.resizeCanvas() }); $('#draw-tools > button.tool').click(function(e) { + $('#text-tool-widget').hide(0); this.handleDrawButton(e.target.id); }.bind(this)); @@ -179,6 +180,7 @@ ascii.Controller.prototype.handleDrawButton = function(id) { if (id == 'text-button') { this.drawFunction = new ascii.DrawText(this.state, this.view); } + this.state.commitDraw(); this.view.canvas.focus(); };