From bb57c0fb24f217c78bdcd66b6085dedaa3f9a3ab Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 4 Oct 2010 09:28:01 -0400 Subject: [PATCH] Improvements to the name-editable path control. --- web_frontend/path_control.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/web_frontend/path_control.js b/web_frontend/path_control.js index 9d00f0e..aa4a625 100644 --- a/web_frontend/path_control.js +++ b/web_frontend/path_control.js @@ -111,15 +111,21 @@ armadillo.PathControl.prototype.decorateInternal = function(element) { path = app.joinPath(path, part); }, this); + var nameComponent = null; if (this.editableLastComponent_) { - var input = new goog.ui.Control(this.dom_.createDom('input')); - input.getElement().value = this.name_; - this.addChild(input, true); + var attrs = { + 'type' : 'text', + 'name' : 'pathName', + 'value' : this.name_ + }; + nameComponent = new goog.ui.Control(this.dom_.createDom('input', attrs)); + nameComponent.setAllowTextSelection(true); + nameComponent.setHandleMouseEvents(true); } else { - var label = new goog.ui.Control(this.name_); - this.addChild(label, true); - goog.dom.classes.add(label.getElement(), 'goog-inline-block'); + nameComponent = new goog.ui.Control(this.name_); } + this.addChild(nameComponent, true); + goog.dom.classes.add(nameComponent.getElement(), 'goog-inline-block'); }; /** -- 2.43.5