Clear selected items when multiselect starts.

This commit is contained in:
Nils Asmussen 2016-08-15 22:03:03 +02:00
parent ea073b4324
commit 7ebe2a1aa0

View File

@ -66,14 +66,13 @@ multiselect.albumContextMenu = function(e, albumObj) {
if ($.inArray(id, multiselect.ids)!=-1) {
contextMenu.albumMulti(multiselect.ids, e)
multiselect.ids = []
}
else {
multiselect.deselect('.photo.active, .album.active')
multiselect.clearSelection()
contextMenu.album(album.getID(), e)
}
multiselect.ids = []
}
multiselect.photoContextMenu = function(e, photoObj) {
@ -82,12 +81,18 @@ multiselect.photoContextMenu = function(e, photoObj) {
if ($.inArray(id, multiselect.ids)!=-1) {
contextMenu.photoMulti(multiselect.ids, e)
multiselect.ids = []
}
else {
multiselect.deselect('.photo.active, .album.active')
multiselect.clearSelection()
contextMenu.photo(photo.getID(), e)
}
}
multiselect.clearSelection = function() {
multiselect.deselect('.photo.active, .album.active')
multiselect.ids = []
}
@ -100,6 +105,8 @@ multiselect.show = function(e) {
if (visible.search()) return false
if (visible.multiselect()) $('#multiselect').remove()
multiselect.clearSelection()
sidebar.setSelectable(false)
multiselect.position.top = e.pageY
@ -304,8 +311,7 @@ multiselect.deselect = function(id) {
multiselect.close = function() {
multiselect.deselect('.photo.active, .album.active')
multiselect.ids = []
multiselect.clearSelection()
sidebar.setSelectable(true)