From 2f32dda3edd619ea1bdc53a8660e5d457c9de599 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 22 Apr 2016 19:26:22 +0300 Subject: [PATCH] fixed a bug in mark/bookmark + some work on sorting with empty .images (not yet happy with this)... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/base.js | 15 ++++++++++++--- ui (gen4)/features/demo.js | 2 +- ui (gen4)/features/ui-marks.js | 21 +++++++++++---------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index bff6ce50..e4acae62 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -665,7 +665,7 @@ module.SortActions = actions.Actions({ var that = this if(method == 'reverse'){ - method = [] + method = 'update' reverse = true } @@ -703,6 +703,11 @@ module.SortActions = actions.Actions({ i = method.indexOf('reverse') } + // can't sort if we know nothing about .images + if(method && method.length > 0 && (!this.images || this.images.length == 0)){ + return + } + // build the compare routine... method = method // remove duplicate methods... @@ -714,6 +719,9 @@ module.SortActions = actions.Actions({ || (function(){ var p = m.split(/\./g) var _get = function(obj){ + if(obj == null){ + return null + } for(var i=0; i