tweaking and notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-08-28 05:43:37 +03:00
parent 8f17dff5c7
commit 76cb68a725
3 changed files with 24 additions and 17 deletions

View File

@ -256,7 +256,7 @@
text-decoration: line-through; text-decoration: line-through;
opacity: 0.3; opacity: 0.3;
} }
.browse-widget .list .item.highlighted { .browse-widget .list .item.highlighted .text {
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
} }

View File

@ -79,7 +79,6 @@ var CollectionActions = actions.Actions({
// } // }
collections: null, collections: null,
get collection(){ get collection(){
return this.location.collection }, return this.location.collection },
set collection(value){ set collection(value){
@ -399,6 +398,9 @@ var CollectionActions = actions.Actions({
// XXX should we do anything special if collection is loaded??? // XXX should we do anything special if collection is loaded???
removeCollection: ['- Collections/', removeCollection: ['- Collections/',
function(collection){ function(collection){
if(collection == MAIN_COLLECTION_TITLE){
return
}
delete this.collections[collection] delete this.collections[collection]
}], }],
@ -419,6 +421,10 @@ var CollectionActions = actions.Actions({
NOTE: this will not account for item topology.`, NOTE: this will not account for item topology.`,
function(gids, collection){ function(gids, collection){
collection = collection || this.collection
if(collection == null || collection == MAIN_COLLECTION_TITLE){
return
}
var that = this var that = this
gids = gids == 'loaded' ? this.data.getImages('loaded') gids = gids == 'loaded' ? this.data.getImages('loaded')
@ -432,12 +438,6 @@ var CollectionActions = actions.Actions({
: [that.data.getImage(gid)] }) : [that.data.getImage(gid)] })
.reduce(function(a, b){ return a.concat(b) }, []) .reduce(function(a, b){ return a.concat(b) }, [])
collection = collection || this.collection
if(collection == null){
return
}
// add to collection... // add to collection...
var data = this.data.constructor.fromArray(gids) var data = this.data.constructor.fromArray(gids)
@ -468,7 +468,7 @@ var CollectionActions = actions.Actions({
`, `,
function(align, collection, data){ function(align, collection, data){
collection = arguments.length == 1 ? align : collection collection = arguments.length == 1 ? align : collection
if(collection == null){ if(collection == null || collection == MAIN_COLLECTION_TITLE){
return return
} }
// if only collection is given, reset align to null... // if only collection is given, reset align to null...
@ -487,6 +487,11 @@ var CollectionActions = actions.Actions({
uncollect: ['Collections|Image/$Uncollect image', uncollect: ['Collections|Image/$Uncollect image',
{browseMode: function(){ return !this.collection && 'disabled' }}, {browseMode: function(){ return !this.collection && 'disabled' }},
function(gids, collection){ function(gids, collection){
collection = collection || this.collection
if(collection == null || collection == MAIN_COLLECTION_TITLE){
return
}
var that = this var that = this
gids = gids == 'loaded' ? this.data.getImages('loaded') gids = gids == 'loaded' ? this.data.getImages('loaded')
@ -500,12 +505,6 @@ var CollectionActions = actions.Actions({
: [that.data.getImage(gid)] }) : [that.data.getImage(gid)] })
.reduce(function(a, b){ return a.concat(b) }, []) .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') /*/ NOTE: we are not using .data.updateImagePositions(gids, 'hide')
// here because it will remove the gids from everything // here because it will remove the gids from everything
// while we need them removed only from ribbons... // while we need them removed only from ribbons...
@ -533,6 +532,9 @@ var CollectionActions = actions.Actions({
.removeEmptyRibbons() .removeEmptyRibbons()
}], }],
// Serialization...
//
// NOTE: this will handle collection title and data only, the rest // NOTE: this will handle collection title and data only, the rest
// is copied in as-is. // is copied in as-is.
// It is the responsibility of the extending features to transform // It is the responsibility of the extending features to transform
@ -651,7 +653,6 @@ var CollectionActions = actions.Actions({
delete this.__collection_order delete this.__collection_order
delete this.location.collection delete this.location.collection
}], }],
clone: [function(full){ clone: [function(full){
return function(res){ return function(res){
if(this.collections){ if(this.collections){
@ -794,6 +795,12 @@ var UICollectionActions = actions.Actions({
check: function(title){ check: function(title){
return title.length > 0 }, 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"??? // XXX should this be "on close"???
itemadded: function(title){ itemadded: function(title){
action ? action ?

View File

@ -138,7 +138,7 @@ module.GLOBAL_KEYBOARD = {
'Collection': { 'Collection': {
pattern: '.collection-mode', pattern: '.collection-mode',
Esc: 'loadCollection: "All"', Esc: 'loadCollection: "All" -- Load all images',
}, },
'Range': { 'Range': {