diff options
author | wei <> | 2006-10-08 05:11:23 +0000 |
---|---|---|
committer | wei <> | 2006-10-08 05:11:23 +0000 |
commit | 9e2820e98640f4ca262db7279a514826341df3e0 (patch) | |
tree | 82184c36e9b82ae57303b7841266cbec23151c5c /framework/Web/Javascripts/prado | |
parent | fe60cc221f922ea362826e2d00431c5df28fe85f (diff) |
Fixed #414, #411, #415
Diffstat (limited to 'framework/Web/Javascripts/prado')
-rw-r--r-- | framework/Web/Javascripts/prado/inlineeditor.js | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/framework/Web/Javascripts/prado/inlineeditor.js b/framework/Web/Javascripts/prado/inlineeditor.js index 14f4b73c..719c525d 100644 --- a/framework/Web/Javascripts/prado/inlineeditor.js +++ b/framework/Web/Javascripts/prado/inlineeditor.js @@ -13,7 +13,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( }, options || {});
this.element = $(this.options.ID);
-
+ Prado.WebUI.TInPlaceTextBox.register(this);
this.initializeListeners();
},
@@ -34,8 +34,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( */
enterEditMode : function(evt)
{
- if (this.isSaving) return;
- if (this.isEditing) return;
+ if (this.isSaving || this.isEditing) return;
this.isEditing = true;
this.onEnterEditMode();
this.createEditorInput();
@@ -49,6 +48,15 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( return false;
},
+ exitEditMode : function(evt)
+ {
+ this.isEditing = false;
+ this.isSaving = false;
+ this.editField.disabled = false;
+ this.element.innerHTML = this.editField.value;
+ this.showLabel();
+ },
+
showTextBox : function()
{
Element.hide(this.element);
@@ -225,4 +233,26 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( this.isSaving = false;
this.isEditing = false;
}
+},
+{
+ textboxes : {},
+
+ register : function(obj)
+ {
+ Prado.WebUI.TInPlaceTextBox.textboxes[obj.options.TextBoxID] = obj;
+ },
+
+ setDisplayTextBox : function(id,value)
+ {
+ var textbox = Prado.WebUI.TInPlaceTextBox.textboxes[id];
+ if(textbox)
+ {
+ if(value)
+ textbox.enterEditMode(null);
+ else
+ {
+ textbox.exitEditMode(null);
+ }
+ }
+ }
});
\ No newline at end of file |