minor refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-11-25 07:28:39 +04:00
parent f1a90de9d3
commit bd27dfa6de

View File

@ -1654,6 +1654,7 @@ function setupBaseURLHistory(){
}) })
} }
function getURLHistoryPosition(){ function getURLHistoryPosition(){
return BASE_URL_HISTORY.indexOf(BASE_URL) return BASE_URL_HISTORY.indexOf(BASE_URL)
} }
@ -1666,12 +1667,18 @@ function getURLHistoryPrev(){
return res == null ? BASE_URL : res return res == null ? BASE_URL : res
} }
function loadURLHistoryNext(){
statusNotify(loadDir(getURLHistoryNext())) function makeURLHistoryLoader(get){
} return function(){
function loadURLHistoryPrev(){ var url = get()
statusNotify(loadDir(getURLHistoryPrev())) if(url != BASE_URL){
statusNotify(loadDir(url))
}
return url
}
} }
var loadURLHistoryNext = makeURLHistoryLoader(getURLHistoryNext)
var loadURLHistoryPrev = makeURLHistoryLoader(getURLHistoryPrev)