bug 372823 - Minor cleanup to reuse helpers where possible. r1=ctalbert, r2=jminta

This commit is contained in:
mattwillis%gmail.com 2007-03-07 01:04:17 +00:00
Родитель 9bfdfa4ff9
Коммит c67297c870
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -222,7 +222,7 @@ function switchToView(aViewType) {
}
function moveView(aNumber) {
getViewDeck().selectedPanel.moveView(aNumber);
currentView().moveView(aNumber);
}
// Helper function to get the view deck in a neutral way, regardless of whether
@ -233,6 +233,9 @@ function getViewDeck() {
return sbDeck || ltnDeck;
}
/**
* Returns the currently visible calendar view.
*/
function currentView() {
return getViewDeck().selectedPanel;
}
@ -242,10 +245,7 @@ function currentView() {
* neutral way
*/
function getSelectedDay() {
var sbView = document.getElementById("view-deck");
var ltnView = document.getElementById("calendar-view-box");
var viewDeck = sbView || ltnView;
return viewDeck.selectedPanel.selectedDay;
return currentView().selectedDay;
}
/** Creates a timer that will fire after midnight. Pass in a function as