preselect the first item if not told otherwise

This commit is contained in:
Marco Martin 2012-04-17 14:56:54 +02:00
parent 021d196ab8
commit 263a184049

View File

@ -92,6 +92,10 @@ function build() {
checkHandlers.push(checkExclusive(item)); checkHandlers.push(checkExclusive(item));
item.checkedChanged.connect(checkHandlers[checkHandlers.length - 1]); item.checkedChanged.connect(checkHandlers[checkHandlers.length - 1]);
} }
if (item.checked) {
checkExclusive(item)()
if (item.checked) self.checkedButton = item
}
} }
var nrButtons = visibleButtons.length; var nrButtons = visibleButtons.length;
@ -100,7 +104,7 @@ function build() {
if (self.checkedButton) if (self.checkedButton)
self.checkedButton.checked = true; self.checkedButton.checked = true;
else if (self.exclusive && self.checkedButton === undefined) { else if (self.exclusive) {
self.checkedButton = visibleButtons[0]; self.checkedButton = visibleButtons[0];
self.checkedButton.checked = true; self.checkedButton.checked = true;
} }