From cfb76fbf0b0dd3dfccc245f052ad2db6083427f5 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 3 Oct 2010 16:12:07 -0400 Subject: [PATCH] Don't create a menu button for the last path component; create an edit field. --- web_frontend/actor.js | 2 +- web_frontend/path_control.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web_frontend/actor.js b/web_frontend/actor.js index b5dda81..d4b27c1 100644 --- a/web_frontend/actor.js +++ b/web_frontend/actor.js @@ -171,7 +171,7 @@ armadillo.Actor.prototype.performMove_ = function() { var container = dialog.getContentElement(); - var editor = new armadillo.PathControl(this.file_.getFullPath()); + var editor = new armadillo.PathControl(this.file_.getFullPath(), false); editor.render(container); /* diff --git a/web_frontend/path_control.js b/web_frontend/path_control.js index da36f6c..c0c6b47 100644 --- a/web_frontend/path_control.js +++ b/web_frontend/path_control.js @@ -11,6 +11,7 @@ goog.provide('armadillo.PathControl'); goog.require('goog.ui.Component'); goog.require('goog.ui.FilteredMenu'); +goog.require('goog.ui.LabelInput'); goog.require('goog.ui.MenuButton'); goog.require('goog.ui.MenuItem'); @@ -77,8 +78,15 @@ armadillo.PathControl.prototype.decorateInternal = function(element) { delete components[0]; // Don't create an empty item. var path = ''; - goog.array.forEach(components, function (part) { - this.addChild(this.createComponentNode_('/' + path, part), true); + goog.array.forEach(components, function (part, i) { + if (i != components.length - 1) { + this.addChild(this.createComponentNode_('/' + path, part), true); + } else { + var input = new goog.ui.LabelInput(part, this.dom_); + this.addChild(input, true); + input.setEnabled(this.editableLastComponent_); + input.setValue(part); + } path += '/' + part; }, this); }; -- 2.43.5