Prevent smart albums to be part of a selection #603
This bug has been introduced by #603
This commit is contained in:
parent
ff5637a7da
commit
d2c7cab3e3
@ -28,17 +28,10 @@ multiselect.bind = function() {
|
|||||||
|
|
||||||
multiselect.toggleItem = function(object, id) {
|
multiselect.toggleItem = function(object, id) {
|
||||||
|
|
||||||
if (album.isSmartID(id)) return
|
|
||||||
|
|
||||||
let pos = $.inArray(id, multiselect.ids)
|
let pos = $.inArray(id, multiselect.ids)
|
||||||
|
|
||||||
if (pos!=-1) {
|
if (pos===-1) multiselect.addItem(object, id)
|
||||||
multiselect.ids.splice(pos, 1)
|
else multiselect.removeItem(object, id)
|
||||||
multiselect.deselect(object)
|
|
||||||
} else {
|
|
||||||
multiselect.ids.push(id)
|
|
||||||
multiselect.select(object)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,10 +39,22 @@ multiselect.addItem = function(object, id) {
|
|||||||
|
|
||||||
let pos = $.inArray(id, multiselect.ids)
|
let pos = $.inArray(id, multiselect.ids)
|
||||||
|
|
||||||
if (pos==-1) {
|
if (album.isSmartID(id)) return
|
||||||
multiselect.ids.push(id)
|
if (pos!==-1) return
|
||||||
multiselect.select(object)
|
|
||||||
}
|
multiselect.ids.push(id)
|
||||||
|
multiselect.select(object)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
multiselect.removeItem = function(object, id) {
|
||||||
|
|
||||||
|
let pos = $.inArray(id, multiselect.ids)
|
||||||
|
|
||||||
|
if (pos===-1) return
|
||||||
|
|
||||||
|
multiselect.ids.splice(pos, 1)
|
||||||
|
multiselect.deselect(object)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user