Skip to content

Commit

Permalink
myDash: drag correctly when height is expanded.
Browse files Browse the repository at this point in the history
Correctly drag icons when the height of the dash is expanded. Compute the total
height of the icons by summing their heights instead of using the container
height.

Conflicts:
	myDash.js
  • Loading branch information
jsrba authored and micheleg committed Sep 19, 2013
1 parent 75048c6 commit 8a9d6ec
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions myDash.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,10 @@ const myDash = new Lang.Class({

let children = this._box.get_children();
let numChildren = children.length;
let boxHeight = this._box.height;
let boxHeight = 0;
for (let i = 0; i < numChildren; i++) {
boxHeight += children[i].height;
}

// Keep the placeholder out of the index calculation; assuming that
// the remove target has the same size as "normal" items, we don't
Expand All @@ -669,9 +672,11 @@ const myDash = new Lang.Class({
}

let pos;
if (!this._emptyDropTarget)
if (!this._emptyDropTarget){
pos = Math.floor(y * numChildren / boxHeight);
else
if (pos > numChildren)
pos = numChildren;
} else
pos = 0; // always insert at the top when dash is empty

if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) {
Expand Down

0 comments on commit 8a9d6ec

Please sign in to comment.