From 63708b60f40bcd36af31f2e66204d90c70dcec95 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 14 Aug 2012 20:12:30 +0400 Subject: [PATCH] added sorting images by path... Signed-off-by: Alex A. Naanou --- ui/TODO.otl | 9 +++++---- ui/gallery-prototype.js | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ui/TODO.otl b/ui/TODO.otl index 581e7f62..dd3a42e4 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -114,7 +114,7 @@ Priority work [X] disable transitions... [_] basic wrapper | hook-in os-specific API - [_] 25% Preview II (optional features) + [_] 28% Preview II (optional features) [_] slideshow... [_] 50% serialization/deserialization [X] JSON loader/unloader @@ -155,10 +155,11 @@ Priority work [_] double tap/click to zoom (a-la iPad) | fit <-> actual pixels (max) [_] pinch to zoom - [_] 66% add sort/re-sort capability... + [X] 100% add sort/re-sort capability... [X] abstract out image id - [_] replace id (use something else like filename) - [X] in-place sort ribbons + [X] replace id (use something else like filename) + [X] re-arrange ribbons (reverse) + [X] in-place sort images in ribbons [_] 50% option to disable processor intensive features [X] global transitions [_] global opacity -- do a layout without opacity diff --git a/ui/gallery-prototype.js b/ui/gallery-prototype.js index d05fe664..ff535b99 100755 --- a/ui/gallery-prototype.js +++ b/ui/gallery-prototype.js @@ -1132,6 +1132,17 @@ function resortImagesVia(cmp){ } +// sort images py their full path... +// XXX this should use a normalized path... +function sortImagesByPath(){ + resortImagesVia(function(a, b){ + a = $(a).css('background-image') + b = $(b).css('background-image') + return a > b ? 1 : a < b ? -1 : 0 + }) +} + + // reverse the order of images in all ribbons by reversing their id attr // and resorting... // NOTE: this is like flipping the field horizontally...