Bug 1215905 - Get rid of the function updateStyle() in the New Event/Task dialog. r=philipp a=aleth

--HG--
extra : amend_source : 15cffb0f20d4391771da4b3667bb12e9319dfbae
This commit is contained in:
Decathlon 2015-12-18 10:42:06 +01:00
Родитель 6e2bc2e137
Коммит 6ede8b1146
2 изменённых файлов: 5 добавлений и 30 удалений

Просмотреть файл

@ -516,9 +516,6 @@ function loadDialog(item) {
// load reminder details
loadReminders(item.getAlarms({}));
// hide rows based on if this is an event or todo
updateStyle();
// Synchronize link-top-image with keep-duration-button status
let keepAttribute = document.getElementById("keepduration-button").getAttribute("keep") == "true";
setBooleanAttribute("link-image-top", "keep", keepAttribute);
@ -1206,33 +1203,6 @@ function updateTitle() {
getElementValue("item-title");
}
/**
* Updates the stylesheet to add rules to hide certain aspects (i.e task only
* elements when editing an event).
*
* TODO We can use general rules here, i.e
* dialog[itemType="task"] .event-only,
* dialog[itemType="event"] .task-only {
* display: none;
* }
*/
function updateStyle() {
const kDialogStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
for (let stylesheet of document.styleSheets) {
if (stylesheet.href == kDialogStylesheet) {
if (cal.isEvent(window.calendarItem)) {
stylesheet.insertRule(".todo-only { display: none; }",
stylesheet.cssRules.length);
} else if (cal.isToDo(window.calendarItem)) {
stylesheet.insertRule(".event-only { display: none; }",
stylesheet.cssRules.length);
}
return;
}
}
}
/**
* Handler function for showing the options menu
*

Просмотреть файл

@ -19,6 +19,11 @@ dialog[systemcolors] {
padding: 0px;
}
#calendar-event-dialog .todo-only,
#calendar-task-dialog .event-only {
display: none;
}
#yearly-period-of-label,
label.label {
text-align: right;