Skip to content

Commit 27c288d

Browse files
committed
fix dependencies and fix dragHandle
1 parent 5374156 commit 27c288d

File tree

6 files changed

+202
-374
lines changed

6 files changed

+202
-374
lines changed

dist/jkanban.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jkanban.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@
5050
<br />
5151
<button id="removeElement">Remove "My Task Test"</button>
5252

53-
<script src="../dist/jkanban.min.js"></script>
53+
<script src="../dist/jkanban.js"></script>
5454
<script>
5555
var KanbanTest = new jKanban({
5656
element: "#myKanban",
5757
gutter: "10px",
5858
widthBoard: "450px",
59+
itemHandleOptions:{
60+
enabled: true,
61+
},
5962
click: function(el) {
6063
console.log("Trigger on all items click!");
6164
},

jkanban.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ var dragula = require("dragula");
6161
}
6262

6363
this.__getCanMove = function(handle) {
64-
if (!self.itemHandleOptions.enabled) {
64+
if (!self.options.itemHandleOptions.enabled) {
6565
return !!self.options.dragItems;
6666
}
6767

68-
if (self.itemHandleOptions.handleClass) {
69-
return handle.classList.contains(self.itemHandleOptions.handleClass);
68+
if (self.options.itemHandleOptions.handleClass) {
69+
return handle.classList.contains(self.options.itemHandleOptions.handleClass);
7070
}
7171

7272
return handle.classList.contains("item_handle")
@@ -207,7 +207,7 @@ var dragula = require("dragula");
207207
nodeItem.dropfn = element.drop;
208208
__appendCustomProperties(nodeItem, element);
209209
__onclickHandler(nodeItem);
210-
if (self.itemHandleOptions.enabled) {
210+
if (self.options.itemHandleOptions.enabled) {
211211
nodeItem.style.cursor = "default";
212212
}
213213
board.appendChild(nodeItem);
@@ -330,7 +330,7 @@ var dragula = require("dragula");
330330
__appendCustomProperties(nodeItem, itemKanban);
331331
//add click handler of item
332332
__onclickHandler(nodeItem);
333-
if (self.itemHandleOptions.enabled) {
333+
if (self.options.itemHandleOptions.enabled) {
334334
nodeItem.style.cursor = "default";
335335
}
336336
contentBoard.appendChild(nodeItem);
@@ -500,10 +500,10 @@ var dragula = require("dragula");
500500

501501
function __buildItemTitle(title) {
502502
var result = title;
503-
if (self.itemHandleOptions.enabled) {
504-
if ((self.itemHandleOptions.customHandler || undefined) === undefined) {
505-
var customCssHandler = self.itemHandleOptions.customCssHandler;
506-
var customCssIconHandler = self.itemHandleOptions.customCssIconHandler;
503+
if (self.options.itemHandleOptions.enabled) {
504+
if ((self.options.itemHandleOptions.customHandler || undefined) === undefined) {
505+
var customCssHandler = self.options.itemHandleOptions.customCssHandler;
506+
var customCssIconHandler = self.options.itemHandleOptions.customCssIconHandler;
507507
if ((customCssHandler || undefined) === undefined) {
508508
customCssHandler = "drag_handler";
509509
}
@@ -513,7 +513,7 @@ var dragula = require("dragula");
513513

514514
result = "<div class='item_handle "+customCssHandler+"'><i class='item_handle "+customCssIconHandler+"'></i></div><div>" + result + "</div>";
515515
} else {
516-
result = self.itemHandleOptions.customHandler.replace("%s", result);
516+
result = self.options.itemHandleOptions.customHandler.replace("%s", result);
517517
}
518518
}
519519
return result;

0 commit comments

Comments
 (0)