Opened 14 years ago

Closed 14 years ago

#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 (1)

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

Download all attachments as: .zip

Change History (2)

comment:1 Changed 14 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Thanks, committed in changeset:71

Changed 13 years ago by anonymous

Note: See TracTickets for help on using tickets.