зеркало из https://github.com/mozilla/pjs.git
Make sure not to enable two radioitems when editing an item with recurrence set.
bug 287393, patch by jt@nerant.org, r=mvl
This commit is contained in:
Родитель
a3ccf3c91d
Коммит
5ccfd8534c
|
@ -366,6 +366,27 @@ function menuListIndexOf(menuList, value)
|
||||||
return -1; // not found
|
return -1; // not found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function radioGroupSelectItem(radioGroupId, id)
|
||||||
|
{
|
||||||
|
var radioGroup = document.getElementById(radioGroupId);
|
||||||
|
var index = radioGroupIndexOf(radioGroup, id);
|
||||||
|
if (index != -1) {
|
||||||
|
radioGroup.selectedIndex = index;
|
||||||
|
} else {
|
||||||
|
throw "radioGroupSelectItem: No such Element: "+id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function radioGroupIndexOf(radioGroup, id)
|
||||||
|
{
|
||||||
|
var items = radioGroup.getElementsByTagName("radio");
|
||||||
|
for each (item in items) {
|
||||||
|
if (item.getAttribute("id") == id)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1; // not found
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function debug(text)
|
function debug(text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -328,13 +328,13 @@ function loadCalendarEventDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!theRule.isFinite) {
|
if (!theRule.isFinite) {
|
||||||
setElementValue("repeat-forever-radio", true, "selected");
|
radioGroupSelectItem("repeat-until-group", "repeat-forever-radio");
|
||||||
} else {
|
} else {
|
||||||
if (theRule.isByCount) {
|
if (theRule.isByCount) {
|
||||||
setElementValue("repeat-numberoftimes-radio", true, "selected");
|
radioGroupSelectItem("repeat-until-group", "repeat-numberoftimes-radio");
|
||||||
setElementValue("repeat-numberoftimes-textbox", theRule.count );
|
setElementValue("repeat-numberoftimes-textbox", theRule.count );
|
||||||
} else {
|
} else {
|
||||||
setElementValue("repeat-until-radio", true, "selected");
|
radioGroupSelectItem("repeat-until-group", "repeat-until-radio");
|
||||||
setElementValue("repeat-end-date-picker", theRule.endDate.jsDate);
|
setElementValue("repeat-end-date-picker", theRule.endDate.jsDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче