From 57f80a607014649f640e116e0d7044a8c77e0de4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 3 Feb 2014 07:46:57 +0400 Subject: [PATCH] more refactoring and simplification... Signed-off-by: Alex A. Naanou --- ui/files.js | 13 +++---------- ui/ui.js | 5 ++++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/files.js b/ui/files.js index ca66e62a..7fbdd267 100755 --- a/ui/files.js +++ b/ui/files.js @@ -1129,6 +1129,7 @@ function readImageDate(gid, images){ return getEXIFDate(normalizePath(img.path)) .done(function(date){ img.ctime = Date.fromTimeStamp(date).getTime()/1000 + imageUpdated(gid) }) } function readImagesDates(images){ @@ -1136,9 +1137,6 @@ function readImagesDates(images){ return $.when.apply(null, $.map(images, function(_, gid){ return readImageDate(gid, images) - .done(function(){ - imageUpdated(gid) - }) })) } function readImagesDatesQ(images){ @@ -1148,10 +1146,6 @@ function readImagesDatesQ(images){ $.each(images, function(gid, img){ queue.enqueue(readImageDate, gid, images) - .always(function(){ - imageUpdated(gid) - //queue.notify(gid, 'done') - }) }) return queue @@ -1209,6 +1203,8 @@ function updateImagesGIDs(images, data){ return $.when.apply(null, $.map(images, function(_, key){ return updateImageGID(key, images, data) })) + + IMAGES_CREATED = true } function updateImagesGIDsQ(images, data){ images = images == null ? IMAGES : images @@ -1217,9 +1213,6 @@ function updateImagesGIDsQ(images, data){ $.each(images, function(key){ queue.enqueue(updateImageGID, key, images, data) - .always(function(){ - //queue.notify(key, 'done') - }) }) IMAGES_CREATED = true diff --git a/ui/ui.js b/ui/ui.js index 21b41739..773a6611 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -263,8 +263,10 @@ function updateInfo(elem, data, target){ elem.append(data) } - return elem + elem .appendTo(target) + + return elem } @@ -381,6 +383,7 @@ function showStatusQ(message){ function showErrorStatus(message){ message = Array.apply(Array, arguments) message.splice(0, 0, 'Error:') + //return showStatusQ.apply(null, message) return updateStatus.apply(null, message) .one('click', function(){ $(this).fadeOut() }) //.stop()