Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set item.Start at current mouse position on drop item over timeline #270

Open
neoburgos opened this issue Jan 29, 2020 · 0 comments
Open

Comments

@neoburgos
Copy link

Hello.
(sorry if I explain myself wrong)

I´m using this example:
https://visjs.github.io/vis-timeline/examples/timeline/other/drag_drop.html

In this code:
https://pastebin.com/Pg0JRsfG

I want drop an item with:
start time : same I get when I do:

timeline.on('drop', function (properties) {
console.log('time at this point: '+properties.time);
});

end time : start time + something (no problem here)

function handleDragStart(event) {
var dragSrcEl = event.target;
event.dataTransfer.effectAllowed = 'move';
var item = {
id: new Date(),
type: 'range',
content: event.target.innerHTML.trim()
};
item.start = WHAT CAN I USE HERE?
item.end = new Date(10006060 + (new Date()).valueOf());
event.dataTransfer.setData("text", JSON.stringify(item));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant