Fixes #249, User should not be able to try to delete "My Library"
This commit is contained in:
parent
433121ec50
commit
146b92585d
2 changed files with 21 additions and 3 deletions
|
@ -291,8 +291,26 @@ var ScholarPane = new function()
|
|||
|
||||
function deleteSelectedCollection()
|
||||
{
|
||||
if(collectionsView.selection.count > 0 && confirm(Scholar.getString('pane.collections.delete')))
|
||||
collectionsView.deleteSelection();
|
||||
if (collectionsView.selection.count == 1)
|
||||
{
|
||||
var row =
|
||||
collectionsView._getItemAtRow(collectionsView.selection.currentIndex);
|
||||
|
||||
if (row.isCollection())
|
||||
{
|
||||
if (confirm(Scholar.getString('pane.collections.delete')))
|
||||
{
|
||||
collectionsView.deleteSelection();
|
||||
}
|
||||
}
|
||||
else if (row.isSearch())
|
||||
{
|
||||
if (confirm(Scholar.getString('pane.collections.deleteSearch')))
|
||||
{
|
||||
collectionsView.deleteSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editSelectedCollection()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
pane.collections.delete = Are you sure you want to delete the selected collection?
|
||||
pane.collections.delete.multiple = Are you sure you want to delete the selected collections?
|
||||
pane.collections.deleteSearch = Are you sure you want to delete the selected search?
|
||||
pane.collections.name = Collection name:
|
||||
pane.collections.rename = Rename collection:
|
||||
pane.collections.library = My Library
|
||||
|
|
Loading…
Reference in a new issue