From 2e3bf2752b911d869b03368bd1e413b3775c6eff Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 26 Dec 2011 16:47:42 -0500 Subject: [PATCH] Fix the tile click handler by binding the option to the event handler --- web_frontend/actor.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index 801ab96..222174f 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -97,7 +97,6 @@ armadillo.Actor.prototype.createTile_ = function(option) { title.text(armadillo.Actor.optionStrings_[value]); var tile = $.createDom('div').addClass('tile'); - tile.actorOption = value; tile.append(title); // Cannot open non-directory files. @@ -105,16 +104,16 @@ armadillo.Actor.prototype.createTile_ = function(option) { return null; } - tile.click(this.tileClickHandler_.bind(this)); + tile.click(this.tileClickHandler_.bind(this, value)); return tile; }; /** * Click handler for individual tiles. + * @param {int} option The Actor.option used * @param {Event} e */ -armadillo.Actor.prototype.tileClickHandler_ = function(e) { - var option = e.target.actorOption; +armadillo.Actor.prototype.tileClickHandler_ = function(option, e) { this.controlContainer_.empty(); this.controlContainer_.show(); if (option == armadillo.Actor.options_.OPEN) { @@ -137,7 +136,7 @@ armadillo.Actor.prototype.tileClickHandler_ = function(e) { */ armadillo.Actor.prototype.performMove_ = function() { var editor = new armadillo.PathControl(this.file_.getFullPath(), true); - this.controlContainer_.append(editor); + this.controlContainer_.append(editor.element_); var okCallback = function(e) { var newPath = editor.getPath(); -- 2.22.5