Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Fixes #605 target: mouse issue with missing pageX/pageY coords. Remov…
Browse files Browse the repository at this point in the history
…e errant console.log
  • Loading branch information
Craga89 committed Oct 8, 2013
1 parent 1d8ddbe commit 06b3d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/core/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ PROTOTYPE.reposition = function(event, effect) {

// If the passed event has no coordinates (such as a scroll event)
else if(!event || !event.pageX) {
// Use cached event for resize/scroll events
if(event && (event.type === 'resize' || event.type === 'scroll')) {
event = cache.event;
}

// Use the mouse origin that caused the show event, if distance hiding is enabled
else if((!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX) {
if((!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX) {
event = cache.origin;
}

// Use cached event for resize/scroll events
else if(!event || (event && (event.type === 'resize' || event.type === 'scroll'))) {
event = cache.event;
}
}

// Calculate body and container offset and take them into account below
Expand Down
2 changes: 0 additions & 2 deletions src/position/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ PLUGINS.viewport = function(api, position, posOptions, targetWidth, targetHeight
overflow2 = initialPos + elemLength - (lengthName === WIDTH ? viewportWidth : viewportHeight) - sideOffset,
offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0);

console.log(initialPos, mySide, atSide, isShift, myLength, atLength, sideOffset, overflow1, overflow2, offset);

// shift
if(isShift) {
offset = (mySide === side1 ? 1 : -1) * myLength;
Expand Down

0 comments on commit 06b3d79

Please sign in to comment.