mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
some cleanup, nots and fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
be4777d384
commit
526830156a
@ -780,7 +780,7 @@ module.Collection = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
var CollectionTags =
|
var CollectionTags =
|
||||||
module.CollectionTags = core.ImageGridFeatures.Feature({
|
module.CollectionTags = core.ImageGridFeatures.Feature({
|
||||||
title: '',
|
title: 'Collection tag handling',
|
||||||
doc: core.doc`Collection tag handling
|
doc: core.doc`Collection tag handling
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
@ -821,6 +821,8 @@ module.CollectionTags = core.ImageGridFeatures.Feature({
|
|||||||
// List of tags to be stored in a collection, unique to it...
|
// List of tags to be stored in a collection, unique to it...
|
||||||
//
|
//
|
||||||
// NOTE: the rest of the tags are shared between all collections
|
// NOTE: the rest of the tags are shared between all collections
|
||||||
|
// NOTE: to disable local tags either delete this, set it to null
|
||||||
|
// or to an empty list.
|
||||||
'collection-local-tags': [
|
'collection-local-tags': [
|
||||||
'bookmark',
|
'bookmark',
|
||||||
'selected',
|
'selected',
|
||||||
@ -828,9 +830,6 @@ module.CollectionTags = core.ImageGridFeatures.Feature({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handlers: [
|
handlers: [
|
||||||
// handle tags...
|
|
||||||
// XXX should tag handling get moved to a separate feature???
|
|
||||||
//
|
|
||||||
// move tags between collections...
|
// move tags between collections...
|
||||||
['collectionLoading.pre',
|
['collectionLoading.pre',
|
||||||
function(title){
|
function(title){
|
||||||
@ -868,7 +867,7 @@ module.CollectionTags = core.ImageGridFeatures.Feature({
|
|||||||
var that = this
|
var that = this
|
||||||
var local_tag_names = this.config['collection-local-tags'] || []
|
var local_tag_names = this.config['collection-local-tags'] || []
|
||||||
|
|
||||||
// do not du anything for main collection unless force is true...
|
// do not do anything for main collection unless force is true...
|
||||||
if(title == MAIN_COLLECTION_TITLE && !force){
|
if(title == MAIN_COLLECTION_TITLE && !force){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -893,10 +892,18 @@ module.CollectionTags = core.ImageGridFeatures.Feature({
|
|||||||
// XXX this seems a bit hacky (???)
|
// XXX this seems a bit hacky (???)
|
||||||
['uncollect.pre',
|
['uncollect.pre',
|
||||||
function(_, gids, title){
|
function(_, gids, title){
|
||||||
|
var that = this
|
||||||
|
var local_tag_names = this.config['collection-local-tags'] || []
|
||||||
|
|
||||||
|
// prevent global tag removal...
|
||||||
var tags = this.data.tags
|
var tags = this.data.tags
|
||||||
delete this.data.tags
|
delete this.data.tags
|
||||||
|
|
||||||
return function(){
|
return function(){
|
||||||
|
// update local tags...
|
||||||
|
local_tag_names.forEach(function(tag){
|
||||||
|
tags[tag] = that.data.makeSparseImages(tags[tag], true) })
|
||||||
|
|
||||||
this.data.tags = tags
|
this.data.tags = tags
|
||||||
this.data.sortTags()
|
this.data.sortTags()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user