From 76cb68a725c06abd4855658e2a64b2a365a7294e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 28 Aug 2017 05:43:37 +0300 Subject: [PATCH] tweaking and notes... Signed-off-by: Alex A. Naanou --- ui (gen4)/css/widget/browse.css | 2 +- ui (gen4)/features/collections.js | 37 ++++++++++++++++++------------- ui (gen4)/features/keyboard.js | 2 +- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ui (gen4)/css/widget/browse.css b/ui (gen4)/css/widget/browse.css index efa73b55..e3ad7bab 100755 --- a/ui (gen4)/css/widget/browse.css +++ b/ui (gen4)/css/widget/browse.css @@ -256,7 +256,7 @@ text-decoration: line-through; opacity: 0.3; } -.browse-widget .list .item.highlighted { +.browse-widget .list .item.highlighted .text { font-style: italic; font-weight: bold; } diff --git a/ui (gen4)/features/collections.js b/ui (gen4)/features/collections.js index ebf5e6d1..75b91ee7 100755 --- a/ui (gen4)/features/collections.js +++ b/ui (gen4)/features/collections.js @@ -79,7 +79,6 @@ var CollectionActions = actions.Actions({ // } collections: null, - get collection(){ return this.location.collection }, set collection(value){ @@ -399,6 +398,9 @@ var CollectionActions = actions.Actions({ // XXX should we do anything special if collection is loaded??? removeCollection: ['- Collections/', function(collection){ + if(collection == MAIN_COLLECTION_TITLE){ + return + } delete this.collections[collection] }], @@ -419,6 +421,10 @@ var CollectionActions = actions.Actions({ NOTE: this will not account for item topology.`, function(gids, collection){ + collection = collection || this.collection + if(collection == null || collection == MAIN_COLLECTION_TITLE){ + return + } var that = this gids = gids == 'loaded' ? this.data.getImages('loaded') @@ -432,12 +438,6 @@ var CollectionActions = actions.Actions({ : [that.data.getImage(gid)] }) .reduce(function(a, b){ return a.concat(b) }, []) - collection = collection || this.collection - - if(collection == null){ - return - } - // add to collection... var data = this.data.constructor.fromArray(gids) @@ -468,7 +468,7 @@ var CollectionActions = actions.Actions({ `, function(align, collection, data){ collection = arguments.length == 1 ? align : collection - if(collection == null){ + if(collection == null || collection == MAIN_COLLECTION_TITLE){ return } // if only collection is given, reset align to null... @@ -487,6 +487,11 @@ var CollectionActions = actions.Actions({ uncollect: ['Collections|Image/$Uncollect image', {browseMode: function(){ return !this.collection && 'disabled' }}, function(gids, collection){ + collection = collection || this.collection + if(collection == null || collection == MAIN_COLLECTION_TITLE){ + return + } + var that = this gids = gids == 'loaded' ? this.data.getImages('loaded') @@ -500,12 +505,6 @@ var CollectionActions = actions.Actions({ : [that.data.getImage(gid)] }) .reduce(function(a, b){ return a.concat(b) }, []) - collection = collection || this.collection - - if(collection == null){ - return - } - /*/ NOTE: we are not using .data.updateImagePositions(gids, 'hide') // here because it will remove the gids from everything // while we need them removed only from ribbons... @@ -533,6 +532,9 @@ var CollectionActions = actions.Actions({ .removeEmptyRibbons() }], + + // Serialization... + // // NOTE: this will handle collection title and data only, the rest // is copied in as-is. // It is the responsibility of the extending features to transform @@ -651,7 +653,6 @@ var CollectionActions = actions.Actions({ delete this.__collection_order delete this.location.collection }], - clone: [function(full){ return function(res){ if(this.collections){ @@ -794,6 +795,12 @@ var UICollectionActions = actions.Actions({ check: function(title){ return title.length > 0 }, + // remove the 'x' button from main collection... + // XXX is this the correct way to go??? + each: function(title){ + title == MAIN_COLLECTION_TITLE + && this.find('.button-container').remove() }, + // XXX should this be "on close"??? itemadded: function(title){ action ? diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index 61c860ee..d7c2fae2 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -138,7 +138,7 @@ module.GLOBAL_KEYBOARD = { 'Collection': { pattern: '.collection-mode', - Esc: 'loadCollection: "All"', + Esc: 'loadCollection: "All" -- Load all images', }, 'Range': {