btn = new Element("input", { type: "image", src: imgsrc, alt: "X"}).setStyle(style);
elt.insert({top: btn});
btn.observe("click", function(evt) {
+ evt.stop();
+ if (typeof options.callback === "function") {
+ options.callback.call(elt);
+ }
elt.hide();
});
}
},
request: function($super, url) {
- this.timeout = (function() {
+ this.timeout = function() {
if (this.options.onFailure) {
this.options.onFailure(null);
}
this.abort();
- }).bind(this).delay(this.delay);
+ }.bind(this).delay(this.delay);
$super(url);
}
});
});
},
- focus: function(form) {
+ setfocus: function(form) {
var tofocus, error;
tofocus = null;
addMessage: function(div, message) {
var node = (div.ownerDocument || document).createTextNode(message);
- if (!div.empty()) {
+
+ if ($A(div.childNodes).filter(function(node) {
+ return (node.nodeType === 3 || node.tagName.toLowerCase() === 'br');
+ }).length) {
div.insert(new Element('br'));
}
+
div.appendChild(node);
return div.show();
},