Update of
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils
In directory
james.mmbase.org:/tmp/cvs-serv17036/cmsc/utilities/src/webapp/editors/utils
Modified Files:
Tag: b1_4
localeditor.js inplaceeditor.js
Log Message:
CMSC-960 - Prototype's getElementsByClassName() no longer works in Firefox 3
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils
See also: http://www.mmbase.org/jira/browse/CMSC-960
Index: localeditor.js
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils/localeditor.js,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -b -r1.4 -r1.4.6.1
--- localeditor.js 12 Dec 2006 09:38:23 -0000 1.4
+++ localeditor.js 12 Jun 2008 14:42:24 -0000 1.4.6.1
@@ -90,12 +90,15 @@
this._checkEmpty();
},
+
_checkEmpty: function(){
if( this.element.innerHTML.length == 0 ){
this.element.appendChild(
-
Builder.node('span',{className:this.options.emptyClassName},this.options.emptyText));
+ Builder.node('span', {className: this.options.emptyClassName},
this.options.emptyText)
+ );
}
},
+
enterEditMode: function(evt) {
this.elementWidth = this.element.offsetWidth;
this.elementHeight = this.element.offsetHeight;
@@ -202,7 +205,7 @@
this.editor = editor;
},
getText: function() {
-
document.getElementsByClassName(this.options.emptyClassName,this.element).each(function(child){
+ this.element.select('.' +
this.options.emptyClassName).each(function(child){
this.element.removeChild(child);
}.bind(this));
return this.element.innerHTML;
Index: inplaceeditor.js
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/editors/utils/inplaceeditor.js,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -b -r1.3 -r1.3.6.1
--- inplaceeditor.js 5 Sep 2006 11:46:43 -0000 1.3
+++ inplaceeditor.js 12 Jun 2008 14:42:24 -0000 1.3.6.1
@@ -25,12 +25,13 @@
_checkEmpty: function(){
if( this.element.innerHTML.length == 0 ){
this.element.appendChild(
-
Builder.node('span',{className:this.options.emptyClassName},this.options.emptyText));
+
Builder.node('span',{className:this.options.emptyClassName},this.options.emptyText)
+ );
}
},
getText: function(){
-
document.getElementsByClassName(this.options.emptyClassName,this.element).each(function(child){
+ this.element.select('.' +
this.options.emptyClassName).each(function(child){
this.element.removeChild(child);
}.bind(this));
return this.__getText();
@@ -40,11 +41,13 @@
this._checkEmpty();
this.__onComplete(transport);
},
+
enterEditMode: function(evt) {
this.elementWidth = this.element.offsetWidth;
this.elementHeight = this.element.offsetHeight;
return this.__enterEditMode(evt);
},
+
createEditField: function() {
var text;
if(this.options.loadTextURL) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs