summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prado/inlineeditor.js
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/prado/inlineeditor.js')
-rw-r--r--framework/Web/Javascripts/prado/inlineeditor.js36
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