Ticket #134 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

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

.2 (0 bytes) - added by anonymous 7 years ago.

Change History

Changed 8 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

Thanks, committed in changeset:71

Changed 7 years ago by anonymous

  • attachment .2 added
Note: See TracTickets for help on using tickets.