Do not add the Open tile for non-directory items.
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 7 Sep 2010 18:38:23 +0000 (14:38 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 7 Sep 2010 18:38:23 +0000 (14:38 -0400)
web_frontend/actor.js
web_frontend/file.js

index 3d32d93b23385d9902f7a6a1660e144d8999063b..9f31a8829e4f4876230b19cd12e4c73ebdd4bbca 100644 (file)
@@ -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);
index be0a7a7bdcd4ae052b9f06f24a63aac8054a39fa..557523e81bede56b81fd9661ae5e804c8a82fb38 100644 (file)
@@ -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.