Skip to content

Commit

Permalink
couple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nsfox committed Jun 17, 2011
1 parent b5c122a commit 551129c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/Browser.js
Expand Up @@ -349,6 +349,7 @@ Browser.prototype.createTrackList = function(parent, params) {
for(var i = 0; i < nodes.length; i++) {
nodes[i].firstChild.childNodes[2].childNodes[1].style.cssText = "color: "+disabledColor;
}
this.selectNone();
}
this._normalizedCreator = oldCreator;
};
Expand Down Expand Up @@ -436,17 +437,17 @@ Browser.prototype.createTrackList = function(parent, params) {
var oldParentItem = sourceItem.getParent().item;
var target = this.targetAnchor;
var model = this.tree.model;
var newParentItem = (target && target.item) || tree.item;
var newParentItem = (target && target.item) || this.tree.item;
var insertIndex;
if(this.dropPosition == "Before" || this.dropPosition == "After"){
newParentItem = (target.getParent() && target.getParent().item) || tree.item;
newParentItem = (target.getParent() && target.getParent().item) || this.tree.item;
// Compute the insert index for reordering
insertIndex = target.getIndexInParent();
if(this.dropPosition == "After"){
insertIndex = target.getIndexInParent() + 1;
}
}else{
newParentItem = (target && target.item) || tree.item;
newParentItem = (target && target.item) || this.tree.item;
}

brwsr.treeModel.pasteItem(childItem, oldParentItem, newParentItem, false, insertIndex);
Expand Down Expand Up @@ -763,13 +764,17 @@ Browser.prototype.createTrackList = function(parent, params) {
dndController: "dijit.tree.dndSource",
showRoot: false,
itemCreator: externalSourceCreator,
onDndDrop: dropOnTrackList,
betweenThreshold: 5,
openOnDblClick: true,
autoExpand: true,
checkItemAcceptance: nodePlacementAcceptance
},
"treeList");

store.save();
brwsr.tree = tree;
brwsr.treeModel = brwsr.treeModel;

// load tracks to the display and disable the track in the track list
var trackNames;
var oldTrackList = dojo.cookie(brwsr.container.id + "-tracks");
Expand Down Expand Up @@ -1121,7 +1126,7 @@ Browser.prototype.showTracks = function(trackNameList) {
var dataObj = {'url' : items[i].url[0],
'label' : items[i].label[0],
'type' : items[i].type[0],
'key' : items[i].key[0],
'key' : items[i].label[0],
'args_chunkSize': (items[i].args_chunkSize? items[i].args_chunkSize[0] : 2000)};
brwsr.viewDndWidget.insertNodes(false, [dataObj]);
}
Expand Down

0 comments on commit 551129c

Please sign in to comment.