This repository was archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix pan issue #657 #2617
Open
mosheDa
wants to merge
14
commits into
almende:develop
Choose a base branch
from
mosheDa:fix_pan_issue
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix pan issue #657 #2617
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
20ff5cb
add paning items near edges feature
mosheDa 2fd5027
support rtl
mosheDa c0b92ff
support move limit
mosheDa 7fddcb6
move event listeners from core.js
mosheDa 200be5a
fix stop move when pan came back from outside
mosheDa bfd8306
clean up code
mosheDa 3a97f28
rename left an d right zones
mosheDa 8d23d64
move mouseLocation properties into touchParams object
mosheDa 0c13c5f
use this instead 'context'
mosheDa 1ff2ba0
Merge branch 'develop' into fix_pan_issue
yotamberk d64a3e8
Merge branch 'develop' into fix_pan_issue
yotamberk 5d453f0
Merge branch 'develop' into fix_pan_issue
yotamberk 61f8059
Merge branch 'develop' into fix_pan_issue
wimrijnders 9e9bc9a
Merge branch 'develop' into fix_pan_issue
wimrijnders File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
support rtl
- Loading branch information
commit 2fd5027d365f0728f506525429c4ccb282e171a2
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1434,16 +1434,18 @@ ItemSet.prototype._onDrag = function (event) { | |
var interval = end - start; | ||
|
||
var distance = (interval * 2) / 100; | ||
// console.log("drag on") | ||
|
||
if(this.body.mouseLocation.mouseOnLeft){ | ||
var newStart = start - distance; | ||
var newEnd = end - distance; | ||
} | ||
else{ | ||
if ((this.options.rtl && this.body.mouseLocation.mouseOnLeft)|| | ||
(!this.options.rtl && this.body.mouseLocation.mouseOnRight)) | ||
{ | ||
var newStart = start + distance; | ||
var newEnd = end + distance; | ||
} | ||
else | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. brackets don't need a new line. should be |
||
var newStart = start - distance; | ||
var newEnd = end - distance; | ||
} | ||
|
||
this.body.range._applyRange(newStart, newEnd); | ||
|
||
|
@@ -1557,19 +1559,24 @@ ItemSet.prototype._onDrag = function (event) { | |
// moshe's code | ||
|
||
|
||
if(this.body.mouseLocation.mouseOnLeft || this.body.mouseLocation.mouseOnRight){ | ||
var range = this.body.getWindow(); | ||
var windowStart = range.start.valueOf(); | ||
var windowEnd = range.end.valueOf(); | ||
|
||
if(this.body.mouseLocation.mouseOnLeft){ | ||
|
||
start = windowStart; | ||
} else { | ||
var itemWidth = props.item.data.end.valueOf() - props.item.data.start.valueOf(); | ||
start = windowEnd - itemWidth; | ||
if(this.body.mouseLocation.mouseOnLeft || this.body.mouseLocation.mouseOnRight){ | ||
var range = this.body.getWindow(); | ||
var windowStart = range.start.valueOf(); | ||
var windowEnd = range.end.valueOf(); | ||
|
||
|
||
if ((this.options.rtl && this.body.mouseLocation.mouseOnLeft)|| | ||
(!this.options.rtl && this.body.mouseLocation.mouseOnRight)) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for new line |
||
var itemWidth = props.item.data.end.valueOf() - props.item.data.start.valueOf(); | ||
start = windowEnd - itemWidth; | ||
|
||
|
||
} else | ||
{ | ||
start = windowStart; | ||
} | ||
} | ||
} | ||
|
||
// | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for new line