From fe0a0dfd94b3ff97f3f1f45e901179bdaa4567c4 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 26 Dec 2011 19:05:45 -0500 Subject: [PATCH] Fix a bug where you could open multiple Actors per File --- web_frontend/actor.js | 14 ++++++++++++++ web_frontend/file.js | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index 8470b0b..15407cb 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -23,6 +23,12 @@ armadillo.Actor = function(file, opt_domHelper) { */ this.file_ = file; + /** + * The root DOM element for the actor. + * @type {Element} + */ + this.element_ = null; + /** * The UI element used for a specific action. * @type {goog.Disposable} @@ -36,6 +42,14 @@ armadillo.Actor = function(file, opt_domHelper) { this.controlContainer_ = null; } +/** + * Gets the root of the Actor. + * @return {Element} + */ +armadillo.Actor.prototype.getElement = function() { + return this.element_; +}; + /** * The different options that the Actor can perform. */ diff --git a/web_frontend/file.js b/web_frontend/file.js index d95c351..7f81d1f 100644 --- a/web_frontend/file.js +++ b/web_frontend/file.js @@ -180,12 +180,12 @@ armadillo.File.prototype.clickHandler_ = function(e) { */ armadillo.File.prototype.actorHandler_ = function(e) { e.stopPropagation(); - if (!this.actor_.element) { + if (!this.actor_.getElement()) { var elm = this.actor_.createDom(); elm.hide(); $(this.element_).append(elm); } - this.actor_.element_.slideToggle('fast'); + this.actor_.getElement().slideToggle('fast'); }; /** -- 2.22.5