mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
04e4e6ccb8
commit
8695b62a02
13
ui/data.js
13
ui/data.js
@ -648,7 +648,8 @@ function saveLocalStorageMarks(attr){
|
||||
*/
|
||||
|
||||
function loadFileImages(path, callback){
|
||||
return $.getJSON(path, function(json){
|
||||
return $.getJSON(path)
|
||||
.done(function(json){
|
||||
IMAGES = json
|
||||
localStorage[DATA_ATTR + '_IMAGES_FILE'] = path
|
||||
console.log('Loaded IMAGES...')
|
||||
@ -659,7 +660,8 @@ function loadFileImages(path, callback){
|
||||
|
||||
function loadFile(data_path, image_path, callback){
|
||||
// CEF
|
||||
return $.getJSON(data_path, function(json){
|
||||
return $.getJSON(data_path)
|
||||
.done(function(json){
|
||||
// legacy format...
|
||||
if(json.version == null){
|
||||
json = convertDataGen1(json)
|
||||
@ -672,19 +674,22 @@ function loadFile(data_path, image_path, callback){
|
||||
} else if(json.version == '2.0') {
|
||||
DATA = json
|
||||
if(image_path != null){
|
||||
loadFileImages(image_path, function(){
|
||||
loadFileImages(image_path)
|
||||
.done(function(){
|
||||
loadData()
|
||||
|
||||
callback != null && callback()
|
||||
})
|
||||
} else if(DATA.image_file != null) {
|
||||
loadFileImages(DATA.image_file, function(){
|
||||
loadFileImages(DATA.image_file)
|
||||
.done(function(){
|
||||
loadData()
|
||||
|
||||
callback != null && callback()
|
||||
})
|
||||
}
|
||||
|
||||
// unknown format...
|
||||
} else {
|
||||
console.error('unknown format.')
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user