Made text tool input hide when leaving the tool

This commit is contained in:
Lewis Hemens 2014-03-23 12:09:25 +00:00
parent b9b46c119e
commit 1ebf356aae
2 changed files with 4 additions and 0 deletions

View File

@ -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) {

View File

@ -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();
};