mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-31 19:30:07 +00:00
added history api...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ef2bc3c38c
commit
f8812049f6
23
ui/data.js
23
ui/data.js
@ -1619,7 +1619,9 @@ function preCacheAllRibbons(){
|
||||
function setupBaseURLHistory(){
|
||||
$('.viewer')
|
||||
.on('baseURLChanged', function(evt, old_url, new_url){
|
||||
BASE_URL_HISTORY.splice(0, 0, old_url)
|
||||
if(BASE_URL_HISTORY.indexOf(old_url) < 0){
|
||||
BASE_URL_HISTORY.splice(0, 0, old_url)
|
||||
}
|
||||
|
||||
// truncate the history if needed...
|
||||
if(BASE_URL_HISTORY.length > BASE_URL_LIMIT){
|
||||
@ -1628,10 +1630,23 @@ function setupBaseURLHistory(){
|
||||
})
|
||||
}
|
||||
|
||||
// XXX...
|
||||
function getNextLocation(){
|
||||
function getURLHistoryPosition(){
|
||||
return BASE_URL_HISTORY.indexOf(BASE_URL)
|
||||
}
|
||||
function getPrevLocation(){
|
||||
function getURLHistoryNext(){
|
||||
var res = BASE_URL_HISTORY[ getURLHistoryPosition() + 1]
|
||||
return res == null ? BASE_URL : res
|
||||
}
|
||||
function getURLHistoryPrev(){
|
||||
var res = BASE_URL_HISTORY[ getURLHistoryPosition() - 1 ]
|
||||
return res == null ? BASE_URL : res
|
||||
}
|
||||
|
||||
function loadURLHistoryNext(){
|
||||
statusNotify(loadDir(getURLHistoryNext()))
|
||||
}
|
||||
function loadURLHistoryPrev(){
|
||||
statusNotify(loadDir(getURLHistoryPrev()))
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user