From eef977d01e4c99e3888640869f2ab48794c1fa1b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 7 Sep 2010 14:38:23 -0400 Subject: [PATCH] Do not add the Open tile for non-directory items. --- web_frontend/actor.js | 4 ++++ web_frontend/file.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index 3d32d93..9f31a88 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -128,6 +128,10 @@ armadillo.Actor.prototype.createElement_ = function() { for (var option in armadillo.Actor.options_) { var tile = goog.dom.createDom('div', 'tile'); var value = armadillo.Actor.options_[option]; + // Cannot open non-directory files. + if (value == armadillo.Actor.options_.OPEN && !this.file_.isDirectory()) { + continue; + } var title = goog.dom.createDom('span', 'title', armadillo.Actor.optionStrings_[value]); goog.dom.appendChild(tile, title); diff --git a/web_frontend/file.js b/web_frontend/file.js index be0a7a7..557523e 100644 --- a/web_frontend/file.js +++ b/web_frontend/file.js @@ -49,6 +49,14 @@ armadillo.File.prototype.getName = function() { return this.name_; }; +/** + * Returns whether or not this is a directory. + * @returns boolean + */ +armadillo.File.prototype.isDirectory = function() { + return this.isDirectory_; +}; + /** * Constructs the Elements that make up the UI. * @returns {Element} An element ready for insertion into DOM. -- 2.22.5