riktar / jkanban

Vanilla Javascript plugin for manage kanban boards
https://www.riccardotartaglia.it/jkanban/
Apache License 2.0
1.08k stars 300 forks source link

Is there an ItemHover callback? #148

Closed bairog closed 2 years ago

bairog commented 2 years ago

Am I missing something or there is no special ItemHover callback? My idea is to display minimal item info in title and show full item data in a tooltip (Bootstrap or jqueryui for example). So hover callback will be ideal for that. Or there is no such and will to use context callback?

xscode-auto-reply[bot] commented 2 years ago

Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/riktar/jkanban

marcosrocha85 commented 2 years ago

No, there's not. But you can handle that with a simple css class. Eg:

...
"item"  : [
{
  "id"    : "item-id-1",
  "title" : "Item 1"
  "class" : ["myItemHoverClass",...]
},
{
  "id"    : "item-id-2",
  "title" : "Item 2",
  "class" : ["myItemHoverClass",...]
}]
...

And implement something (jQuery probably) like:

$(".myItemHoverClass").on("hover", function(e) {
  if(e.type === "mouseenter") {
    console.log("over");
  }
  else if (e.type === "mouseleave") {
    console.log("out");
  }
});