Ticket #134 (closed defect: fixed)
Dialog buttons fail to be created
| Reported by: | cj@… | Owned by: | gogo |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Xinha Core | Version: | 2.0 |
| Severity: | critical | Keywords: | dialog buttons |
| Cc: |
Description
Just noticed that the dialog buttons aren't being created properly on the latest SVN, if you check popupwin.js you'll notice an error since 'buttons' isn't a valid array in this context -- this can be fixed by just using 'btn'. I'm not sure if it's the correct fix as I don't recognize the new _lc language function but it works:
PopupWin.prototype.addButtons = function() {
var self = this;
var div = this.doc.createElement("div");
this.content.appendChild(div);
div.className = "buttons";
for (var i = 0; i < arguments.length; ++i) {
var btn = arguments[i];
var button = this.doc.createElement("button");
div.appendChild(button);
button.innerHTML = HTMLArea._lc(btn, 'HTMLArea'); // *** -- changed buttons[btn] to btn
switch (btn) {
case "ok":
button.onclick = function() {
self.callHandler();
self.close();
return false;
};
break;
case "cancel":
button.onclick = function() {
self.close();
return false;
};
break;
}
}
};
Thanks and please keep up the great work!
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
