|
|
@ -1,4 +1,28 @@
|
|
|
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
|
|
(function e(t, n, r) {
|
|
|
|
|
|
|
|
function s(o, u) {
|
|
|
|
|
|
|
|
if (!n[o]) {
|
|
|
|
|
|
|
|
if (!t[o]) {
|
|
|
|
|
|
|
|
var a = typeof require == "function" && require;
|
|
|
|
|
|
|
|
if (!u && a) return a(o, !0);
|
|
|
|
|
|
|
|
if (i) return i(o, !0);
|
|
|
|
|
|
|
|
var f = new Error("Cannot find module '" + o + "'");
|
|
|
|
|
|
|
|
throw f.code = "MODULE_NOT_FOUND", f
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var l = n[o] = {
|
|
|
|
|
|
|
|
exports: {}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
t[o][0].call(l.exports, function (e) {
|
|
|
|
|
|
|
|
var n = t[o][1][e];
|
|
|
|
|
|
|
|
return s(n ? n : e)
|
|
|
|
|
|
|
|
}, l, l.exports, e, t, n, r)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return n[o].exports
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var i = typeof require == "function" && require;
|
|
|
|
|
|
|
|
for (var o = 0; o < r.length; o++) s(r[o]);
|
|
|
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
})({
|
|
|
|
|
|
|
|
1: [function (require, module, exports) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* jKanban
|
|
|
|
* jKanban
|
|
|
|
* Vanilla Javascript plugin for manage kanban boards
|
|
|
|
* Vanilla Javascript plugin for manage kanban boards
|
|
|
@ -32,30 +56,18 @@ var dragula = require('dragula');
|
|
|
|
dragBoards: true,
|
|
|
|
dragBoards: true,
|
|
|
|
addItemButton: false,
|
|
|
|
addItemButton: false,
|
|
|
|
buttonContent: '+',
|
|
|
|
buttonContent: '+',
|
|
|
|
dragEl: function (el, source) {
|
|
|
|
dragEl: function (el, source) {},
|
|
|
|
},
|
|
|
|
dragendEl: function (el) {},
|
|
|
|
dragendEl: function (el) {
|
|
|
|
dropEl: function (el, target, source, sibling) {},
|
|
|
|
},
|
|
|
|
dragBoard: function (el, source) {},
|
|
|
|
dropEl: function (el, target, source, sibling) {
|
|
|
|
dragendBoard: function (el) {},
|
|
|
|
},
|
|
|
|
dropBoard: function (el, target, source, sibling) {},
|
|
|
|
dragBoard: function (el, source) {
|
|
|
|
click: function (el) {},
|
|
|
|
},
|
|
|
|
boardTitleclick: function (el, boardId) {},
|
|
|
|
dragendBoard: function (el) {
|
|
|
|
buttonClick: function (el, boardId) {},
|
|
|
|
},
|
|
|
|
colorClick: function (el, boardId) {},
|
|
|
|
dropBoard: function (el, target, source, sibling) {
|
|
|
|
removeClick: function (el, boardId) {},
|
|
|
|
},
|
|
|
|
onChange: function () {}
|
|
|
|
click: function (el) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
boardTitleclick: function (el, boardId) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
buttonClick: function (el, boardId) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
colorClick: function (el, boardId) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
removeClick: function(el, boardId) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onChange: function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (arguments[0] && typeof arguments[0] === "object") {
|
|
|
|
if (arguments[0] && typeof arguments[0] === "object") {
|
|
|
@ -100,8 +112,12 @@ var dragula = require('dragula');
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: update board object board order
|
|
|
|
// TODO: update board object board order
|
|
|
|
console.log("Drop " + $(el).attr("data-id") + " just before " + (sibling ? $(sibling).attr("data-id") : " end "));
|
|
|
|
console.log("Drop " + $(el).attr("data-id") + " just before " + (sibling ? $(sibling).attr("data-id") : " end "));
|
|
|
|
var index1 = self.options.boards.findIndex(function(element) { return element.id==$(el).attr("data-id"); });
|
|
|
|
var index1 = self.options.boards.findIndex(function (element) {
|
|
|
|
var index2 = sibling ? self.options.boards.findIndex(function(element) { return element.id==$(sibling).attr("data-id"); }) : self.options.boards.length;
|
|
|
|
return element.id == $(el).attr("data-id");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
var index2 = sibling ? self.options.boards.findIndex(function (element) {
|
|
|
|
|
|
|
|
return element.id == $(sibling).attr("data-id");
|
|
|
|
|
|
|
|
}) : self.options.boards.length;
|
|
|
|
console.log("Switch " + index1 + " and " + index2);
|
|
|
|
console.log("Switch " + index1 + " and " + index2);
|
|
|
|
if (index1 < index2)
|
|
|
|
if (index1 < index2)
|
|
|
|
index2 = index2 - 1;
|
|
|
|
index2 = index2 - 1;
|
|
|
@ -142,7 +158,9 @@ var dragula = require('dragula');
|
|
|
|
.on('cancel', function (el, container, source) {
|
|
|
|
.on('cancel', function (el, container, source) {
|
|
|
|
console.log("In cancel");
|
|
|
|
console.log("In cancel");
|
|
|
|
if (confirm("Do you want to remove this item?")) {
|
|
|
|
if (confirm("Do you want to remove this item?")) {
|
|
|
|
var board1 = self.options.boards.find(function(element) { return element.id==$(source.parentNode).attr("data-id"); });
|
|
|
|
var board1 = self.options.boards.find(function (element) {
|
|
|
|
|
|
|
|
return element.id == $(source.parentNode).attr("data-id");
|
|
|
|
|
|
|
|
});
|
|
|
|
var pos1 = self.dragItemPos;
|
|
|
|
var pos1 = self.dragItemPos;
|
|
|
|
board1.item.splice(pos1, 1);
|
|
|
|
board1.item.splice(pos1, 1);
|
|
|
|
$(el).remove();
|
|
|
|
$(el).remove();
|
|
|
@ -153,8 +171,12 @@ var dragula = require('dragula');
|
|
|
|
console.log("In drop");
|
|
|
|
console.log("In drop");
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: update board object board order
|
|
|
|
// TODO: update board object board order
|
|
|
|
var board1 = self.options.boards.find(function(element) { return element.id==$(source.parentNode).attr("data-id"); });
|
|
|
|
var board1 = self.options.boards.find(function (element) {
|
|
|
|
var board2 = self.options.boards.find(function(element) { return element.id==$(target.parentNode).attr("data-id"); });
|
|
|
|
return element.id == $(source.parentNode).attr("data-id");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
var board2 = self.options.boards.find(function (element) {
|
|
|
|
|
|
|
|
return element.id == $(target.parentNode).attr("data-id");
|
|
|
|
|
|
|
|
});
|
|
|
|
var pos1 = self.dragItemPos;
|
|
|
|
var pos1 = self.dragItemPos;
|
|
|
|
var pos2 = (sibling) ? self.findElementPosition(sibling) : (board2.item.length + 1);
|
|
|
|
var pos2 = (sibling) ? self.findElementPosition(sibling) : (board2.item.length + 1);
|
|
|
|
console.log("Drop element " + pos1 + " before " + pos2);
|
|
|
|
console.log("Drop element " + pos1 + " before " + pos2);
|
|
|
@ -199,7 +221,9 @@ var dragula = require('dragula');
|
|
|
|
|
|
|
|
|
|
|
|
// add Element to JSON
|
|
|
|
// add Element to JSON
|
|
|
|
var boardJSON = __findBoardJSON(boardID);
|
|
|
|
var boardJSON = __findBoardJSON(boardID);
|
|
|
|
boardJSON.item.push({ title : element.title });
|
|
|
|
boardJSON.item.push({
|
|
|
|
|
|
|
|
title: element.title
|
|
|
|
|
|
|
|
});
|
|
|
|
var board = self.element.querySelector('[data-id="' + boardID + '"] .kanban-drag');
|
|
|
|
var board = self.element.querySelector('[data-id="' + boardID + '"] .kanban-drag');
|
|
|
|
var nodeItem = document.createElement('div');
|
|
|
|
var nodeItem = document.createElement('div');
|
|
|
|
nodeItem.classList.add('kanban-item');
|
|
|
|
nodeItem.classList.add('kanban-item');
|
|
|
@ -494,22 +518,33 @@ var dragula = require('dragula');
|
|
|
|
}());
|
|
|
|
}());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},{"dragula":9}],2:[function(require,module,exports){
|
|
|
|
}, {
|
|
|
|
module.exports = function atoa (a, n) { return Array.prototype.slice.call(a, n); }
|
|
|
|
"dragula": 9
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
2: [function (require, module, exports) {
|
|
|
|
|
|
|
|
module.exports = function atoa(a, n) {
|
|
|
|
|
|
|
|
return Array.prototype.slice.call(a, n);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},{}],3:[function(require,module,exports){
|
|
|
|
}, {}],
|
|
|
|
|
|
|
|
3: [function (require, module, exports) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var ticky = require('ticky');
|
|
|
|
var ticky = require('ticky');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function debounce(fn, args, ctx) {
|
|
|
|
module.exports = function debounce(fn, args, ctx) {
|
|
|
|
if (!fn) { return; }
|
|
|
|
if (!fn) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
ticky(function run() {
|
|
|
|
ticky(function run() {
|
|
|
|
fn.apply(ctx || null, args || []);
|
|
|
|
fn.apply(ctx || null, args || []);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
},{"ticky":10}],4:[function(require,module,exports){
|
|
|
|
}, {
|
|
|
|
|
|
|
|
"ticky": 10
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
4: [function (require, module, exports) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var atoa = require('atoa');
|
|
|
|
var atoa = require('atoa');
|
|
|
@ -518,7 +553,9 @@ var debounce = require('./debounce');
|
|
|
|
module.exports = function emitter(thing, options) {
|
|
|
|
module.exports = function emitter(thing, options) {
|
|
|
|
var opts = options || {};
|
|
|
|
var opts = options || {};
|
|
|
|
var evt = {};
|
|
|
|
var evt = {};
|
|
|
|
if (thing === undefined) { thing = {}; }
|
|
|
|
if (thing === undefined) {
|
|
|
|
|
|
|
|
thing = {};
|
|
|
|
|
|
|
|
}
|
|
|
|
thing.on = function (type, fn) {
|
|
|
|
thing.on = function (type, fn) {
|
|
|
|
if (!evt[type]) {
|
|
|
|
if (!evt[type]) {
|
|
|
|
evt[type] = [fn];
|
|
|
|
evt[type] = [fn];
|
|
|
@ -540,7 +577,9 @@ module.exports = function emitter (thing, options) {
|
|
|
|
evt = {};
|
|
|
|
evt = {};
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var et = evt[type];
|
|
|
|
var et = evt[type];
|
|
|
|
if (!et) { return thing; }
|
|
|
|
if (!et) {
|
|
|
|
|
|
|
|
return thing;
|
|
|
|
|
|
|
|
}
|
|
|
|
et.splice(et.indexOf(fn), 1);
|
|
|
|
et.splice(et.indexOf(fn), 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return thing;
|
|
|
|
return thing;
|
|
|
@ -554,10 +593,18 @@ module.exports = function emitter (thing, options) {
|
|
|
|
return function () {
|
|
|
|
return function () {
|
|
|
|
var args = atoa(arguments);
|
|
|
|
var args = atoa(arguments);
|
|
|
|
var ctx = this || thing;
|
|
|
|
var ctx = this || thing;
|
|
|
|
if (type === 'error' && opts.throws !== false && !et.length) { throw args.length === 1 ? args[0] : args; }
|
|
|
|
if (type === 'error' && opts.throws !== false && !et.length) {
|
|
|
|
|
|
|
|
throw args.length === 1 ? args[0] : args;
|
|
|
|
|
|
|
|
}
|
|
|
|
et.forEach(function emitter(listen) {
|
|
|
|
et.forEach(function emitter(listen) {
|
|
|
|
if (opts.async) { debounce(listen, args, ctx); } else { listen.apply(ctx, args); }
|
|
|
|
if (opts.async) {
|
|
|
|
if (listen._once) { thing.off(type, listen); }
|
|
|
|
debounce(listen, args, ctx);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
listen.apply(ctx, args);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listen._once) {
|
|
|
|
|
|
|
|
thing.off(type, listen);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return thing;
|
|
|
|
return thing;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -565,7 +612,11 @@ module.exports = function emitter (thing, options) {
|
|
|
|
return thing;
|
|
|
|
return thing;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
},{"./debounce":3,"atoa":2}],5:[function(require,module,exports){
|
|
|
|
}, {
|
|
|
|
|
|
|
|
"./debounce": 3,
|
|
|
|
|
|
|
|
"atoa": 2
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
5: [function (require, module, exports) {
|
|
|
|
(function (global) {
|
|
|
|
(function (global) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
@ -613,6 +664,7 @@ function fabricateEvent (el, type, model) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
el.fireEvent('on' + type, e);
|
|
|
|
el.fireEvent('on' + type, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function makeClassicEvent() {
|
|
|
|
function makeClassicEvent() {
|
|
|
|
var e;
|
|
|
|
var e;
|
|
|
|
if (doc.createEvent) {
|
|
|
|
if (doc.createEvent) {
|
|
|
@ -623,8 +675,11 @@ function fabricateEvent (el, type, model) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return e;
|
|
|
|
return e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function makeCustomEvent() {
|
|
|
|
function makeCustomEvent() {
|
|
|
|
return new customEvent(type, { detail: model });
|
|
|
|
return new customEvent(type, {
|
|
|
|
|
|
|
|
detail: model
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -632,8 +687,12 @@ function wrapperFactory (el, type, fn) {
|
|
|
|
return function wrapper(originalEvent) {
|
|
|
|
return function wrapper(originalEvent) {
|
|
|
|
var e = originalEvent || global.event;
|
|
|
|
var e = originalEvent || global.event;
|
|
|
|
e.target = e.target || e.srcElement;
|
|
|
|
e.target = e.target || e.srcElement;
|
|
|
|
e.preventDefault = e.preventDefault || function preventDefault () { e.returnValue = false; };
|
|
|
|
e.preventDefault = e.preventDefault || function preventDefault() {
|
|
|
|
e.stopPropagation = e.stopPropagation || function stopPropagation () { e.cancelBubble = true; };
|
|
|
|
e.returnValue = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
e.stopPropagation = e.stopPropagation || function stopPropagation() {
|
|
|
|
|
|
|
|
e.cancelBubble = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
e.which = e.which || e.keyCode;
|
|
|
|
e.which = e.which || e.keyCode;
|
|
|
|
fn.call(el, e);
|
|
|
|
fn.call(el, e);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -670,7 +729,11 @@ function find (el, type, fn) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
},{"./eventmap":6,"custom-event":7}],6:[function(require,module,exports){
|
|
|
|
}, {
|
|
|
|
|
|
|
|
"./eventmap": 6,
|
|
|
|
|
|
|
|
"custom-event": 7
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
6: [function (require, module, exports) {
|
|
|
|
(function (global) {
|
|
|
|
(function (global) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
@ -687,17 +750,21 @@ for (eventname in global) {
|
|
|
|
module.exports = eventmap;
|
|
|
|
module.exports = eventmap;
|
|
|
|
|
|
|
|
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
},{}],7:[function(require,module,exports){
|
|
|
|
}, {}],
|
|
|
|
|
|
|
|
7: [function (require, module, exports) {
|
|
|
|
(function (global) {
|
|
|
|
(function (global) {
|
|
|
|
|
|
|
|
|
|
|
|
var NativeCustomEvent = global.CustomEvent;
|
|
|
|
var NativeCustomEvent = global.CustomEvent;
|
|
|
|
|
|
|
|
|
|
|
|
function useNative() {
|
|
|
|
function useNative() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
var p = new NativeCustomEvent('cat', { detail: { foo: 'bar' } });
|
|
|
|
var p = new NativeCustomEvent('cat', {
|
|
|
|
return 'cat' === p.type && 'bar' === p.detail.foo;
|
|
|
|
detail: {
|
|
|
|
} catch (e) {
|
|
|
|
foo: 'bar'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return 'cat' === p.type && 'bar' === p.detail.foo;
|
|
|
|
|
|
|
|
} catch (e) {}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -739,7 +806,8 @@ function CustomEvent (type, params) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
},{}],8:[function(require,module,exports){
|
|
|
|
}, {}],
|
|
|
|
|
|
|
|
8: [function (require, module, exports) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var cache = {};
|
|
|
|
var cache = {};
|
|
|
@ -774,7 +842,8 @@ module.exports = {
|
|
|
|
rm: rmClass
|
|
|
|
rm: rmClass
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
},{}],9:[function(require,module,exports){
|
|
|
|
}, {}],
|
|
|
|
|
|
|
|
9: [function (require, module, exports) {
|
|
|
|
(function (global) {
|
|
|
|
(function (global) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
@ -805,18 +874,42 @@ function dragula (initialContainers, options) {
|
|
|
|
var _grabbed; // holds mousedown context until first mousemove
|
|
|
|
var _grabbed; // holds mousedown context until first mousemove
|
|
|
|
|
|
|
|
|
|
|
|
var o = options || {};
|
|
|
|
var o = options || {};
|
|
|
|
if (o.moves === void 0) { o.moves = always; }
|
|
|
|
if (o.moves === void 0) {
|
|
|
|
if (o.accepts === void 0) { o.accepts = always; }
|
|
|
|
o.moves = always;
|
|
|
|
if (o.invalid === void 0) { o.invalid = invalidTarget; }
|
|
|
|
}
|
|
|
|
if (o.containers === void 0) { o.containers = initialContainers || []; }
|
|
|
|
if (o.accepts === void 0) {
|
|
|
|
if (o.isContainer === void 0) { o.isContainer = never; }
|
|
|
|
o.accepts = always;
|
|
|
|
if (o.copy === void 0) { o.copy = false; }
|
|
|
|
}
|
|
|
|
if (o.copySortSource === void 0) { o.copySortSource = false; }
|
|
|
|
if (o.invalid === void 0) {
|
|
|
|
if (o.revertOnSpill === void 0) { o.revertOnSpill = false; }
|
|
|
|
o.invalid = invalidTarget;
|
|
|
|
if (o.removeOnSpill === void 0) { o.removeOnSpill = false; }
|
|
|
|
}
|
|
|
|
if (o.direction === void 0) { o.direction = 'vertical'; }
|
|
|
|
if (o.containers === void 0) {
|
|
|
|
if (o.ignoreInputTextSelection === void 0) { o.ignoreInputTextSelection = true; }
|
|
|
|
o.containers = initialContainers || [];
|
|
|
|
if (o.mirrorContainer === void 0) { o.mirrorContainer = doc.body; }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.isContainer === void 0) {
|
|
|
|
|
|
|
|
o.isContainer = never;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.copy === void 0) {
|
|
|
|
|
|
|
|
o.copy = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.copySortSource === void 0) {
|
|
|
|
|
|
|
|
o.copySortSource = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.revertOnSpill === void 0) {
|
|
|
|
|
|
|
|
o.revertOnSpill = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.removeOnSpill === void 0) {
|
|
|
|
|
|
|
|
o.removeOnSpill = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.direction === void 0) {
|
|
|
|
|
|
|
|
o.direction = 'vertical';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.ignoreInputTextSelection === void 0) {
|
|
|
|
|
|
|
|
o.ignoreInputTextSelection = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (o.mirrorContainer === void 0) {
|
|
|
|
|
|
|
|
o.mirrorContainer = doc.body;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var drake = emitter({
|
|
|
|
var drake = emitter({
|
|
|
|
containers: o.containers,
|
|
|
|
containers: o.containers,
|
|
|
@ -1184,9 +1277,22 @@ function dragula (initialContainers, options) {
|
|
|
|
dropTarget.insertBefore(item, reference);
|
|
|
|
dropTarget.insertBefore(item, reference);
|
|
|
|
drake.emit('shadow', item, dropTarget, _source);
|
|
|
|
drake.emit('shadow', item, dropTarget, _source);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function moved (type) { drake.emit(type, item, _lastDropTarget, _source); }
|
|
|
|
|
|
|
|
function over () { if (changed) { moved('over'); } }
|
|
|
|
function moved(type) {
|
|
|
|
function out () { if (_lastDropTarget) { moved('out'); } }
|
|
|
|
drake.emit(type, item, _lastDropTarget, _source);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function over() {
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
|
|
|
|
moved('over');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function out() {
|
|
|
|
|
|
|
|
if (_lastDropTarget) {
|
|
|
|
|
|
|
|
moved('out');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function spillOver(el) {
|
|
|
|
function spillOver(el) {
|
|
|
@ -1194,7 +1300,9 @@ function dragula (initialContainers, options) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function spillOut(el) {
|
|
|
|
function spillOut(el) {
|
|
|
|
if (drake.dragging) { classes.add(el, 'gu-hide'); }
|
|
|
|
if (drake.dragging) {
|
|
|
|
|
|
|
|
classes.add(el, 'gu-hide');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function renderMirrorImage() {
|
|
|
|
function renderMirrorImage() {
|
|
|
@ -1246,8 +1354,12 @@ function dragula (initialContainers, options) {
|
|
|
|
for (i = 0; i < len; i++) {
|
|
|
|
for (i = 0; i < len; i++) {
|
|
|
|
el = dropTarget.children[i];
|
|
|
|
el = dropTarget.children[i];
|
|
|
|
rect = el.getBoundingClientRect();
|
|
|
|
rect = el.getBoundingClientRect();
|
|
|
|
if (horizontal && (rect.left + rect.width / 2) > x) { return el; }
|
|
|
|
if (horizontal && (rect.left + rect.width / 2) > x) {
|
|
|
|
if (!horizontal && (rect.top + rect.height / 2) > y) { return el; }
|
|
|
|
return el;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!horizontal && (rect.top + rect.height / 2) > y) {
|
|
|
|
|
|
|
|
return el;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1297,9 +1409,15 @@ function touchy (el, op, type, fn) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function whichMouseButton(e) {
|
|
|
|
function whichMouseButton(e) {
|
|
|
|
if (e.touches !== void 0) { return e.touches.length; }
|
|
|
|
if (e.touches !== void 0) {
|
|
|
|
if (e.which !== void 0 && e.which !== 0) { return e.which; } // see https://github.com/bevacqua/dragula/issues/261
|
|
|
|
return e.touches.length;
|
|
|
|
if (e.buttons !== void 0) { return e.buttons; }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (e.which !== void 0 && e.which !== 0) {
|
|
|
|
|
|
|
|
return e.which;
|
|
|
|
|
|
|
|
} // see https://github.com/bevacqua/dragula/issues/261
|
|
|
|
|
|
|
|
if (e.buttons !== void 0) {
|
|
|
|
|
|
|
|
return e.buttons;
|
|
|
|
|
|
|
|
}
|
|
|
|
var button = e.button;
|
|
|
|
var button = e.button;
|
|
|
|
if (button !== void 0) { // see https://github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575
|
|
|
|
if (button !== void 0) { // see https://github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575
|
|
|
|
return button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);
|
|
|
|
return button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);
|
|
|
@ -1334,21 +1452,46 @@ function getElementBehindPoint (point, x, y) {
|
|
|
|
return el;
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function never () { return false; }
|
|
|
|
function never() {
|
|
|
|
function always () { return true; }
|
|
|
|
return false;
|
|
|
|
function getRectWidth (rect) { return rect.width || (rect.right - rect.left); }
|
|
|
|
}
|
|
|
|
function getRectHeight (rect) { return rect.height || (rect.bottom - rect.top); }
|
|
|
|
|
|
|
|
function getParent (el) { return el.parentNode === doc ? null : el.parentNode; }
|
|
|
|
function always() {
|
|
|
|
function isInput (el) { return el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable(el); }
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getRectWidth(rect) {
|
|
|
|
|
|
|
|
return rect.width || (rect.right - rect.left);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getRectHeight(rect) {
|
|
|
|
|
|
|
|
return rect.height || (rect.bottom - rect.top);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getParent(el) {
|
|
|
|
|
|
|
|
return el.parentNode === doc ? null : el.parentNode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isInput(el) {
|
|
|
|
|
|
|
|
return el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable(el);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function isEditable(el) {
|
|
|
|
function isEditable(el) {
|
|
|
|
if (!el) { return false; } // no parents were editable
|
|
|
|
if (!el) {
|
|
|
|
if (el.contentEditable === 'false') { return false; } // stop the lookup
|
|
|
|
return false;
|
|
|
|
if (el.contentEditable === 'true') { return true; } // found a contentEditable element in the chain
|
|
|
|
} // no parents were editable
|
|
|
|
|
|
|
|
if (el.contentEditable === 'false') {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
} // stop the lookup
|
|
|
|
|
|
|
|
if (el.contentEditable === 'true') {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} // found a contentEditable element in the chain
|
|
|
|
return isEditable(getParent(el)); // contentEditable is set to 'inherit'
|
|
|
|
return isEditable(getParent(el)); // contentEditable is set to 'inherit'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function nextEl(el) {
|
|
|
|
function nextEl(el) {
|
|
|
|
return el.nextElementSibling || manually();
|
|
|
|
return el.nextElementSibling || manually();
|
|
|
|
|
|
|
|
|
|
|
|
function manually() {
|
|
|
|
function manually() {
|
|
|
|
var sibling = el;
|
|
|
|
var sibling = el;
|
|
|
|
do {
|
|
|
|
do {
|
|
|
@ -1386,13 +1529,24 @@ function getCoord (coord, e) {
|
|
|
|
module.exports = dragula;
|
|
|
|
module.exports = dragula;
|
|
|
|
|
|
|
|
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
|
},{"./classes":8,"contra/emitter":4,"crossvent":5}],10:[function(require,module,exports){
|
|
|
|
}, {
|
|
|
|
var si = typeof setImmediate === 'function', tick;
|
|
|
|
"./classes": 8,
|
|
|
|
|
|
|
|
"contra/emitter": 4,
|
|
|
|
|
|
|
|
"crossvent": 5
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
10: [function (require, module, exports) {
|
|
|
|
|
|
|
|
var si = typeof setImmediate === 'function',
|
|
|
|
|
|
|
|
tick;
|
|
|
|
if (si) {
|
|
|
|
if (si) {
|
|
|
|
tick = function (fn) { setImmediate(fn); };
|
|
|
|
tick = function (fn) {
|
|
|
|
|
|
|
|
setImmediate(fn);
|
|
|
|
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
tick = function (fn) { setTimeout(fn, 0); };
|
|
|
|
tick = function (fn) {
|
|
|
|
|
|
|
|
setTimeout(fn, 0);
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = tick;
|
|
|
|
module.exports = tick;
|
|
|
|
},{}]},{},[1]);
|
|
|
|
}, {}]
|
|
|
|
|
|
|
|
}, {}, [1]);
|