Author: abelevich
Date: 2010-08-16 09:28:02 -0400 (Mon, 16 Aug 2010)
New Revision: 18661
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
fix recursive calls
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-08-16
13:15:57 UTC (rev 18660)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-08-16
13:28:02 UTC (rev 18661)
@@ -153,3 +153,7 @@
.rf-ii-none {
clip:rect(0px, 0px, 1px, 1px);
}
+
+.rf-ii-none {
+ clip:rect(0px 0px 1px 1px);
+}
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-16
13:15:57 UTC (rev 18660)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-16
13:28:02 UTC (rev 18661)
@@ -15,11 +15,12 @@
this.label = $(document.getElementById(options.label));
this.initialValue = this.label.text();
- richfaces.Event.bind(this.element, this.editEvent, this.edit, this);
- richfaces.Event.bind(this.input, "change", this.save, this);
- richfaces.Event.bind(this.input, "blur", this.save, this);
- richfaces.Event.bind(this.input, "focus", this.edit, this);
-
+ richfaces.Event.bind(this.element, this.editEvent, this.__editHandler,
this);
+ richfaces.Event.bind(this.input, "change", this.__saveHandler,
this);
+ richfaces.Event.bind(this.input, "blur", this.__saveHandler,
this);
+
+ /* TODO: discuss this with Pavel */
+ this.__boundEditFunc = richfaces.Event.bind(this.input, "focus",
this.__editHandler, this);
if(this.showControls) {
this.okbtn = $(document.getElementById(options.okbtn));
this.cancelbtn = $(document.getElementById(options.cancelbtn));
@@ -42,7 +43,7 @@
edit: function() {
this.editContainer.removeClass(this.noneCss);
- this.input.focus();
+ this.input.focus();
},
save: function() {
@@ -79,15 +80,27 @@
/****************** private methods *****************************************/
- __saveBtnHandler: function() {
- this.save();
+ __saveBtnHandler: function(e) {
+ this.input.blur();
this.editContainer.addClass(this.noneCss);
return false;
},
- __cancelBtnHandler: function() {
- this.cancel(); return false;
+ __cancelBtnHandler: function(e) {
+ this.cancel(); this.input.blur(); return false;
+ },
+
+ __editHandler: function(e) {
+ richfaces.Event.unbind(this.input, "focus",
this.__boundEditFunc);
+ this.__boundEditFunc = null;
+ this.edit();
+ this.__boundEditFunc = richfaces.Event.bind(this.input,
"focus", this.__editHandler, this);
+ },
+
+ __saveHandler: function(e) {
+ this.save();
}
+
}
})());