[interface] You should now be able to drop collections below the library (into root).
[interface] New items are automatically selected.
This commit is contained in:
parent
4545a5d8a8
commit
1336842d74
3 changed files with 8 additions and 12 deletions
|
@ -248,11 +248,8 @@ Scholar.CollectionTreeView.prototype._refreshHashMap = function()
|
||||||
|
|
||||||
Scholar.CollectionTreeView.prototype.canDrop = function(row, orient)
|
Scholar.CollectionTreeView.prototype.canDrop = function(row, orient)
|
||||||
{
|
{
|
||||||
if(orient == 0 && this._getItemAtRow(row).isCollection())
|
if((row == 0 && orient == 1) || orient == 0)
|
||||||
{
|
|
||||||
Scholar.debug("drag on row: " + row + " orient: " + orient);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +266,7 @@ Scholar.CollectionTreeView.prototype.drop = function(row, orient)
|
||||||
var oldCount = this.rowCount;
|
var oldCount = this.rowCount;
|
||||||
|
|
||||||
var targetCollectionID;
|
var targetCollectionID;
|
||||||
if(this.canDrop(row,orient))
|
if(this._getItemAtRow(row).isCollection())
|
||||||
targetCollectionID = this._getItemAtRow(row).ref.getID();
|
targetCollectionID = this._getItemAtRow(row).ref.getID();
|
||||||
|
|
||||||
var droppedCollection = Scholar.Collections.get(ids[0]);
|
var droppedCollection = Scholar.Collections.get(ids[0]);
|
||||||
|
@ -300,7 +297,6 @@ Scholar.CollectionTreeView.prototype.getSupportedFlavours = function ()
|
||||||
return flavors;
|
return flavors;
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.CollectionTreeView.prototype.onDragOver = function (evt,dropdata,session) { }
|
|
||||||
Scholar.CollectionTreeView.prototype.onDrop = function (evt,dropdata,session) { }
|
Scholar.CollectionTreeView.prototype.onDrop = function (evt,dropdata,session) { }
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -253,9 +253,6 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids)
|
||||||
|
|
||||||
if(madeChanges)
|
if(madeChanges)
|
||||||
{
|
{
|
||||||
if(action == 'add')
|
|
||||||
this.selection.select(this._itemRowMap[item.getID()]);
|
|
||||||
|
|
||||||
if(this.isSorted())
|
if(this.isSorted())
|
||||||
{
|
{
|
||||||
this.sort(); //this also refreshes the hash map
|
this.sort(); //this also refreshes the hash map
|
||||||
|
@ -266,6 +263,9 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids)
|
||||||
this._refreshHashMap();
|
this._refreshHashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(action == 'add')
|
||||||
|
this.selection.select(this._itemRowMap[item.getID()]);
|
||||||
|
else
|
||||||
this.rememberSelection();
|
this.rememberSelection();
|
||||||
}
|
}
|
||||||
this.selection.selectEventsSuppressed = false;
|
this.selection.selectEventsSuppressed = false;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</toolbar>
|
</toolbar>
|
||||||
<tree id="collections-tree" hidecolumnpicker="true"
|
<tree id="collections-tree" hidecolumnpicker="true"
|
||||||
onselect="ScholarPane.onCollectionSelected();" seltype="single"
|
onselect="ScholarPane.onCollectionSelected();" seltype="single"
|
||||||
ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getCollectionsView())" ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
|
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
|
||||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getCollectionsView());"
|
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getCollectionsView());"
|
||||||
onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteCollectionSelection(); return false; }"
|
onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteCollectionSelection(); return false; }"
|
||||||
flex="1">
|
flex="1">
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
enableColumnDrag="true" onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteItemSelection(); return false; }"
|
enableColumnDrag="true" onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteItemSelection(); return false; }"
|
||||||
onselect="ScholarPane.itemSelected();"
|
onselect="ScholarPane.itemSelected();"
|
||||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getItemsView());"
|
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getItemsView());"
|
||||||
ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getItemsView())" ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
|
ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
|
||||||
flex="1">
|
flex="1">
|
||||||
<treecols>
|
<treecols>
|
||||||
<treecol
|
<treecol
|
||||||
|
|
Loading…
Reference in a new issue