@innovastudio/contentbox 1.6.38 → 1.6.40
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/public/contentbox/contentbox.esm.js +674 -971
- package/public/contentbox/contentbox.min.js +10 -10
- package/readme.txt +10 -0
@@ -39535,33 +39535,27 @@ const renderGridEditor = builder => {
|
|
39535
39535
|
};
|
39536
39536
|
|
39537
39537
|
/**!
|
39538
|
-
* Sortable 1.
|
39538
|
+
* Sortable 1.15.2
|
39539
39539
|
* @author RubaXa <trash@rubaxa.org>
|
39540
39540
|
* @author owenm <owen23355@gmail.com>
|
39541
39541
|
* @license MIT
|
39542
39542
|
*/
|
39543
39543
|
function ownKeys$1(object, enumerableOnly) {
|
39544
39544
|
var keys = Object.keys(object);
|
39545
|
-
|
39546
39545
|
if (Object.getOwnPropertySymbols) {
|
39547
39546
|
var symbols = Object.getOwnPropertySymbols(object);
|
39548
|
-
|
39549
39547
|
if (enumerableOnly) {
|
39550
39548
|
symbols = symbols.filter(function (sym) {
|
39551
39549
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
39552
39550
|
});
|
39553
39551
|
}
|
39554
|
-
|
39555
39552
|
keys.push.apply(keys, symbols);
|
39556
39553
|
}
|
39557
|
-
|
39558
39554
|
return keys;
|
39559
39555
|
}
|
39560
|
-
|
39561
39556
|
function _objectSpread2$1(target) {
|
39562
39557
|
for (var i = 1; i < arguments.length; i++) {
|
39563
39558
|
var source = arguments[i] != null ? arguments[i] : {};
|
39564
|
-
|
39565
39559
|
if (i % 2) {
|
39566
39560
|
ownKeys$1(Object(source), true).forEach(function (key) {
|
39567
39561
|
_defineProperty$1(target, key, source[key]);
|
@@ -39574,10 +39568,8 @@ function _objectSpread2$1(target) {
|
|
39574
39568
|
});
|
39575
39569
|
}
|
39576
39570
|
}
|
39577
|
-
|
39578
39571
|
return target;
|
39579
39572
|
}
|
39580
|
-
|
39581
39573
|
function _typeof$1(obj) {
|
39582
39574
|
"@babel/helpers - typeof";
|
39583
39575
|
|
@@ -39590,10 +39582,8 @@ function _typeof$1(obj) {
|
|
39590
39582
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
39591
39583
|
};
|
39592
39584
|
}
|
39593
|
-
|
39594
39585
|
return _typeof$1(obj);
|
39595
39586
|
}
|
39596
|
-
|
39597
39587
|
function _defineProperty$1(obj, key, value) {
|
39598
39588
|
if (key in obj) {
|
39599
39589
|
Object.defineProperty(obj, key, {
|
@@ -39605,53 +39595,40 @@ function _defineProperty$1(obj, key, value) {
|
|
39605
39595
|
} else {
|
39606
39596
|
obj[key] = value;
|
39607
39597
|
}
|
39608
|
-
|
39609
39598
|
return obj;
|
39610
39599
|
}
|
39611
|
-
|
39612
39600
|
function _extends() {
|
39613
39601
|
_extends = Object.assign || function (target) {
|
39614
39602
|
for (var i = 1; i < arguments.length; i++) {
|
39615
39603
|
var source = arguments[i];
|
39616
|
-
|
39617
39604
|
for (var key in source) {
|
39618
39605
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
39619
39606
|
target[key] = source[key];
|
39620
39607
|
}
|
39621
39608
|
}
|
39622
39609
|
}
|
39623
|
-
|
39624
39610
|
return target;
|
39625
39611
|
};
|
39626
|
-
|
39627
39612
|
return _extends.apply(this, arguments);
|
39628
39613
|
}
|
39629
|
-
|
39630
39614
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
39631
39615
|
if (source == null) return {};
|
39632
39616
|
var target = {};
|
39633
39617
|
var sourceKeys = Object.keys(source);
|
39634
39618
|
var key, i;
|
39635
|
-
|
39636
39619
|
for (i = 0; i < sourceKeys.length; i++) {
|
39637
39620
|
key = sourceKeys[i];
|
39638
39621
|
if (excluded.indexOf(key) >= 0) continue;
|
39639
39622
|
target[key] = source[key];
|
39640
39623
|
}
|
39641
|
-
|
39642
39624
|
return target;
|
39643
39625
|
}
|
39644
|
-
|
39645
39626
|
function _objectWithoutProperties(source, excluded) {
|
39646
39627
|
if (source == null) return {};
|
39647
|
-
|
39648
39628
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
39649
|
-
|
39650
39629
|
var key, i;
|
39651
|
-
|
39652
39630
|
if (Object.getOwnPropertySymbols) {
|
39653
39631
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
39654
|
-
|
39655
39632
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
39656
39633
|
key = sourceSymbolKeys[i];
|
39657
39634
|
if (excluded.indexOf(key) >= 0) continue;
|
@@ -39659,18 +39636,16 @@ function _objectWithoutProperties(source, excluded) {
|
|
39659
39636
|
target[key] = source[key];
|
39660
39637
|
}
|
39661
39638
|
}
|
39662
|
-
|
39663
39639
|
return target;
|
39664
39640
|
}
|
39665
39641
|
|
39666
|
-
var version$1 = "1.
|
39642
|
+
var version$1 = "1.15.2";
|
39667
39643
|
|
39668
39644
|
function userAgent(pattern) {
|
39669
39645
|
if (typeof window !== 'undefined' && window.navigator) {
|
39670
39646
|
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
39671
39647
|
}
|
39672
39648
|
}
|
39673
|
-
|
39674
39649
|
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
39675
39650
|
var Edge = userAgent(/Edge/i);
|
39676
39651
|
var FireFox = userAgent(/firefox/i);
|
@@ -39682,23 +39657,15 @@ var captureMode = {
|
|
39682
39657
|
capture: false,
|
39683
39658
|
passive: false
|
39684
39659
|
};
|
39685
|
-
|
39686
39660
|
function on(el, event, fn) {
|
39687
39661
|
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
39688
39662
|
}
|
39689
|
-
|
39690
39663
|
function off(el, event, fn) {
|
39691
39664
|
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
39692
39665
|
}
|
39693
|
-
|
39694
|
-
function matches(
|
39695
|
-
/**HTMLElement*/
|
39696
|
-
el,
|
39697
|
-
/**String*/
|
39698
|
-
selector) {
|
39666
|
+
function matches( /**HTMLElement*/el, /**String*/selector) {
|
39699
39667
|
if (!selector) return;
|
39700
39668
|
selector[0] === '>' && (selector = selector.substring(1));
|
39701
|
-
|
39702
39669
|
if (el) {
|
39703
39670
|
try {
|
39704
39671
|
if (el.matches) {
|
@@ -39712,39 +39679,25 @@ selector) {
|
|
39712
39679
|
return false;
|
39713
39680
|
}
|
39714
39681
|
}
|
39715
|
-
|
39716
39682
|
return false;
|
39717
39683
|
}
|
39718
|
-
|
39719
39684
|
function getParentOrHost(el) {
|
39720
39685
|
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
39721
39686
|
}
|
39722
|
-
|
39723
|
-
function closest(
|
39724
|
-
/**HTMLElement*/
|
39725
|
-
el,
|
39726
|
-
/**String*/
|
39727
|
-
selector,
|
39728
|
-
/**HTMLElement*/
|
39729
|
-
ctx, includeCTX) {
|
39687
|
+
function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
|
39730
39688
|
if (el) {
|
39731
39689
|
ctx = ctx || document;
|
39732
|
-
|
39733
39690
|
do {
|
39734
39691
|
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
39735
39692
|
return el;
|
39736
39693
|
}
|
39737
|
-
|
39738
39694
|
if (el === ctx) break;
|
39739
39695
|
/* jshint boss:true */
|
39740
39696
|
} while (el = getParentOrHost(el));
|
39741
39697
|
}
|
39742
|
-
|
39743
39698
|
return null;
|
39744
39699
|
}
|
39745
|
-
|
39746
39700
|
var R_SPACE = /\s+/g;
|
39747
|
-
|
39748
39701
|
function toggleClass$1(el, name, state) {
|
39749
39702
|
if (el && name) {
|
39750
39703
|
if (el.classList) {
|
@@ -39755,10 +39708,8 @@ function toggleClass$1(el, name, state) {
|
|
39755
39708
|
}
|
39756
39709
|
}
|
39757
39710
|
}
|
39758
|
-
|
39759
39711
|
function css$2(el, prop, val) {
|
39760
39712
|
var style = el && el.style;
|
39761
|
-
|
39762
39713
|
if (style) {
|
39763
39714
|
if (val === void 0) {
|
39764
39715
|
if (document.defaultView && document.defaultView.getComputedStyle) {
|
@@ -39766,83 +39717,67 @@ function css$2(el, prop, val) {
|
|
39766
39717
|
} else if (el.currentStyle) {
|
39767
39718
|
val = el.currentStyle;
|
39768
39719
|
}
|
39769
|
-
|
39770
39720
|
return prop === void 0 ? val : val[prop];
|
39771
39721
|
} else {
|
39772
39722
|
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
39773
39723
|
prop = '-webkit-' + prop;
|
39774
39724
|
}
|
39775
|
-
|
39776
39725
|
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
39777
39726
|
}
|
39778
39727
|
}
|
39779
39728
|
}
|
39780
|
-
|
39781
39729
|
function matrix(el, selfOnly) {
|
39782
39730
|
var appliedTransforms = '';
|
39783
|
-
|
39784
39731
|
if (typeof el === 'string') {
|
39785
39732
|
appliedTransforms = el;
|
39786
39733
|
} else {
|
39787
39734
|
do {
|
39788
39735
|
var transform = css$2(el, 'transform');
|
39789
|
-
|
39790
39736
|
if (transform && transform !== 'none') {
|
39791
39737
|
appliedTransforms = transform + ' ' + appliedTransforms;
|
39792
39738
|
}
|
39793
39739
|
/* jshint boss:true */
|
39794
|
-
|
39795
39740
|
} while (!selfOnly && (el = el.parentNode));
|
39796
39741
|
}
|
39797
|
-
|
39798
39742
|
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
39799
39743
|
/*jshint -W056 */
|
39800
|
-
|
39801
39744
|
return matrixFn && new matrixFn(appliedTransforms);
|
39802
39745
|
}
|
39803
|
-
|
39804
39746
|
function find$2(ctx, tagName, iterator) {
|
39805
39747
|
if (ctx) {
|
39806
39748
|
var list = ctx.getElementsByTagName(tagName),
|
39807
|
-
|
39808
|
-
|
39809
|
-
|
39749
|
+
i = 0,
|
39750
|
+
n = list.length;
|
39810
39751
|
if (iterator) {
|
39811
39752
|
for (; i < n; i++) {
|
39812
39753
|
iterator(list[i], i);
|
39813
39754
|
}
|
39814
39755
|
}
|
39815
|
-
|
39816
39756
|
return list;
|
39817
39757
|
}
|
39818
|
-
|
39819
39758
|
return [];
|
39820
39759
|
}
|
39821
|
-
|
39822
39760
|
function getWindowScrollingElement() {
|
39823
39761
|
var scrollingElement = document.scrollingElement;
|
39824
|
-
|
39825
39762
|
if (scrollingElement) {
|
39826
39763
|
return scrollingElement;
|
39827
39764
|
} else {
|
39828
39765
|
return document.documentElement;
|
39829
39766
|
}
|
39830
39767
|
}
|
39831
|
-
/**
|
39832
|
-
* Returns the "bounding client rect" of given element
|
39833
|
-
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
39834
|
-
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
39835
|
-
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
39836
|
-
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
39837
|
-
* @param {[HTMLElement]} container The parent the element will be placed in
|
39838
|
-
* @return {Object} The boundingClientRect of el, with specified adjustments
|
39839
|
-
*/
|
39840
|
-
|
39841
39768
|
|
39769
|
+
/**
|
39770
|
+
* Returns the "bounding client rect" of given element
|
39771
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
39772
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
39773
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
39774
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
39775
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
39776
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
39777
|
+
*/
|
39842
39778
|
function getRect$1(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
39843
39779
|
if (!el.getBoundingClientRect && el !== window) return;
|
39844
39780
|
var elRect, top, left, bottom, right, height, width;
|
39845
|
-
|
39846
39781
|
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
39847
39782
|
elRect = el.getBoundingClientRect();
|
39848
39783
|
top = elRect.top;
|
@@ -39859,17 +39794,18 @@ function getRect$1(el, relativeToContainingBlock, relativeToNonStaticParent, und
|
|
39859
39794
|
height = window.innerHeight;
|
39860
39795
|
width = window.innerWidth;
|
39861
39796
|
}
|
39862
|
-
|
39863
39797
|
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
39864
39798
|
// Adjust for translate()
|
39865
|
-
container = container || el.parentNode;
|
39866
|
-
// Not needed on <= IE11
|
39799
|
+
container = container || el.parentNode;
|
39867
39800
|
|
39801
|
+
// solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
39802
|
+
// Not needed on <= IE11
|
39868
39803
|
if (!IE11OrLess) {
|
39869
39804
|
do {
|
39870
39805
|
if (container && container.getBoundingClientRect && (css$2(container, 'transform') !== 'none' || relativeToNonStaticParent && css$2(container, 'position') !== 'static')) {
|
39871
|
-
var containerRect = container.getBoundingClientRect();
|
39806
|
+
var containerRect = container.getBoundingClientRect();
|
39872
39807
|
|
39808
|
+
// Set relative to edges of padding box of container
|
39873
39809
|
top -= containerRect.top + parseInt(css$2(container, 'border-top-width'));
|
39874
39810
|
left -= containerRect.left + parseInt(css$2(container, 'border-left-width'));
|
39875
39811
|
bottom = top + elRect.height;
|
@@ -39877,17 +39813,14 @@ function getRect$1(el, relativeToContainingBlock, relativeToNonStaticParent, und
|
|
39877
39813
|
break;
|
39878
39814
|
}
|
39879
39815
|
/* jshint boss:true */
|
39880
|
-
|
39881
39816
|
} while (container = container.parentNode);
|
39882
39817
|
}
|
39883
39818
|
}
|
39884
|
-
|
39885
39819
|
if (undoScale && el !== window) {
|
39886
39820
|
// Adjust for scale()
|
39887
39821
|
var elMatrix = matrix(container || el),
|
39888
|
-
|
39889
|
-
|
39890
|
-
|
39822
|
+
scaleX = elMatrix && elMatrix.a,
|
39823
|
+
scaleY = elMatrix && elMatrix.d;
|
39891
39824
|
if (elMatrix) {
|
39892
39825
|
top /= scaleY;
|
39893
39826
|
left /= scaleX;
|
@@ -39897,7 +39830,6 @@ function getRect$1(el, relativeToContainingBlock, relativeToNonStaticParent, und
|
|
39897
39830
|
right = left + width;
|
39898
39831
|
}
|
39899
39832
|
}
|
39900
|
-
|
39901
39833
|
return {
|
39902
39834
|
top: top,
|
39903
39835
|
left: left,
|
@@ -39907,165 +39839,140 @@ function getRect$1(el, relativeToContainingBlock, relativeToNonStaticParent, und
|
|
39907
39839
|
height: height
|
39908
39840
|
};
|
39909
39841
|
}
|
39910
|
-
/**
|
39911
|
-
* Checks if a side of an element is scrolled past a side of its parents
|
39912
|
-
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
39913
|
-
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
39914
|
-
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
39915
|
-
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
39916
|
-
*/
|
39917
|
-
|
39918
39842
|
|
39843
|
+
/**
|
39844
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
39845
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
39846
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
39847
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
39848
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
39849
|
+
*/
|
39919
39850
|
function isScrolledPast(el, elSide, parentSide) {
|
39920
39851
|
var parent = getParentAutoScrollElement(el, true),
|
39921
|
-
|
39922
|
-
/* jshint boss:true */
|
39852
|
+
elSideVal = getRect$1(el)[elSide];
|
39923
39853
|
|
39854
|
+
/* jshint boss:true */
|
39924
39855
|
while (parent) {
|
39925
39856
|
var parentSideVal = getRect$1(parent)[parentSide],
|
39926
|
-
|
39927
|
-
|
39857
|
+
visible = void 0;
|
39928
39858
|
if (parentSide === 'top' || parentSide === 'left') {
|
39929
39859
|
visible = elSideVal >= parentSideVal;
|
39930
39860
|
} else {
|
39931
39861
|
visible = elSideVal <= parentSideVal;
|
39932
39862
|
}
|
39933
|
-
|
39934
39863
|
if (!visible) return parent;
|
39935
39864
|
if (parent === getWindowScrollingElement()) break;
|
39936
39865
|
parent = getParentAutoScrollElement(parent, false);
|
39937
39866
|
}
|
39938
|
-
|
39939
39867
|
return false;
|
39940
39868
|
}
|
39941
|
-
/**
|
39942
|
-
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
39943
|
-
* and non-draggable elements
|
39944
|
-
* @param {HTMLElement} el The parent element
|
39945
|
-
* @param {Number} childNum The index of the child
|
39946
|
-
* @param {Object} options Parent Sortable's options
|
39947
|
-
* @return {HTMLElement} The child at index childNum, or null if not found
|
39948
|
-
*/
|
39949
|
-
|
39950
39869
|
|
39870
|
+
/**
|
39871
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
39872
|
+
* and non-draggable elements
|
39873
|
+
* @param {HTMLElement} el The parent element
|
39874
|
+
* @param {Number} childNum The index of the child
|
39875
|
+
* @param {Object} options Parent Sortable's options
|
39876
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
39877
|
+
*/
|
39951
39878
|
function getChild(el, childNum, options, includeDragEl) {
|
39952
39879
|
var currentChild = 0,
|
39953
|
-
|
39954
|
-
|
39955
|
-
|
39880
|
+
i = 0,
|
39881
|
+
children = el.children;
|
39956
39882
|
while (i < children.length) {
|
39957
39883
|
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
39958
39884
|
if (currentChild === childNum) {
|
39959
39885
|
return children[i];
|
39960
39886
|
}
|
39961
|
-
|
39962
39887
|
currentChild++;
|
39963
39888
|
}
|
39964
|
-
|
39965
39889
|
i++;
|
39966
39890
|
}
|
39967
|
-
|
39968
39891
|
return null;
|
39969
39892
|
}
|
39970
|
-
/**
|
39971
|
-
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
39972
|
-
* @param {HTMLElement} el Parent element
|
39973
|
-
* @param {selector} selector Any other elements that should be ignored
|
39974
|
-
* @return {HTMLElement} The last child, ignoring ghostEl
|
39975
|
-
*/
|
39976
|
-
|
39977
39893
|
|
39894
|
+
/**
|
39895
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
39896
|
+
* @param {HTMLElement} el Parent element
|
39897
|
+
* @param {selector} selector Any other elements that should be ignored
|
39898
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
39899
|
+
*/
|
39978
39900
|
function lastChild(el, selector) {
|
39979
39901
|
var last = el.lastElementChild;
|
39980
|
-
|
39981
39902
|
while (last && (last === Sortable.ghost || css$2(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
39982
39903
|
last = last.previousElementSibling;
|
39983
39904
|
}
|
39984
|
-
|
39985
39905
|
return last || null;
|
39986
39906
|
}
|
39987
|
-
/**
|
39988
|
-
* Returns the index of an element within its parent for a selected set of
|
39989
|
-
* elements
|
39990
|
-
* @param {HTMLElement} el
|
39991
|
-
* @param {selector} selector
|
39992
|
-
* @return {number}
|
39993
|
-
*/
|
39994
|
-
|
39995
39907
|
|
39908
|
+
/**
|
39909
|
+
* Returns the index of an element within its parent for a selected set of
|
39910
|
+
* elements
|
39911
|
+
* @param {HTMLElement} el
|
39912
|
+
* @param {selector} selector
|
39913
|
+
* @return {number}
|
39914
|
+
*/
|
39996
39915
|
function index(el, selector) {
|
39997
39916
|
var index = 0;
|
39998
|
-
|
39999
39917
|
if (!el || !el.parentNode) {
|
40000
39918
|
return -1;
|
40001
39919
|
}
|
40002
|
-
/* jshint boss:true */
|
40003
|
-
|
40004
39920
|
|
39921
|
+
/* jshint boss:true */
|
40005
39922
|
while (el = el.previousElementSibling) {
|
40006
39923
|
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
40007
39924
|
index++;
|
40008
39925
|
}
|
40009
39926
|
}
|
40010
|
-
|
40011
39927
|
return index;
|
40012
39928
|
}
|
40013
|
-
/**
|
40014
|
-
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
40015
|
-
* The value is returned in real pixels.
|
40016
|
-
* @param {HTMLElement} el
|
40017
|
-
* @return {Array} Offsets in the format of [left, top]
|
40018
|
-
*/
|
40019
|
-
|
40020
39929
|
|
39930
|
+
/**
|
39931
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
39932
|
+
* The value is returned in real pixels.
|
39933
|
+
* @param {HTMLElement} el
|
39934
|
+
* @return {Array} Offsets in the format of [left, top]
|
39935
|
+
*/
|
40021
39936
|
function getRelativeScrollOffset(el) {
|
40022
39937
|
var offsetLeft = 0,
|
40023
|
-
|
40024
|
-
|
40025
|
-
|
39938
|
+
offsetTop = 0,
|
39939
|
+
winScroller = getWindowScrollingElement();
|
40026
39940
|
if (el) {
|
40027
39941
|
do {
|
40028
39942
|
var elMatrix = matrix(el),
|
40029
|
-
|
40030
|
-
|
39943
|
+
scaleX = elMatrix.a,
|
39944
|
+
scaleY = elMatrix.d;
|
40031
39945
|
offsetLeft += el.scrollLeft * scaleX;
|
40032
39946
|
offsetTop += el.scrollTop * scaleY;
|
40033
39947
|
} while (el !== winScroller && (el = el.parentNode));
|
40034
39948
|
}
|
40035
|
-
|
40036
39949
|
return [offsetLeft, offsetTop];
|
40037
39950
|
}
|
40038
|
-
/**
|
40039
|
-
* Returns the index of the object within the given array
|
40040
|
-
* @param {Array} arr Array that may or may not hold the object
|
40041
|
-
* @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
|
40042
|
-
* @return {Number} The index of the object in the array, or -1
|
40043
|
-
*/
|
40044
|
-
|
40045
39951
|
|
39952
|
+
/**
|
39953
|
+
* Returns the index of the object within the given array
|
39954
|
+
* @param {Array} arr Array that may or may not hold the object
|
39955
|
+
* @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
|
39956
|
+
* @return {Number} The index of the object in the array, or -1
|
39957
|
+
*/
|
40046
39958
|
function indexOfObject(arr, obj) {
|
40047
39959
|
for (var i in arr) {
|
40048
39960
|
if (!arr.hasOwnProperty(i)) continue;
|
40049
|
-
|
40050
39961
|
for (var key in obj) {
|
40051
39962
|
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
40052
39963
|
}
|
40053
39964
|
}
|
40054
|
-
|
40055
39965
|
return -1;
|
40056
39966
|
}
|
40057
|
-
|
40058
39967
|
function getParentAutoScrollElement(el, includeSelf) {
|
40059
39968
|
// skip to window
|
40060
39969
|
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
40061
39970
|
var elem = el;
|
40062
39971
|
var gotSelf = false;
|
40063
|
-
|
40064
39972
|
do {
|
40065
39973
|
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
40066
39974
|
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
40067
39975
|
var elemCSS = css$2(elem);
|
40068
|
-
|
40069
39976
|
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
40070
39977
|
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
40071
39978
|
if (gotSelf || includeSelf) return elem;
|
@@ -40073,12 +39980,9 @@ function getParentAutoScrollElement(el, includeSelf) {
|
|
40073
39980
|
}
|
40074
39981
|
}
|
40075
39982
|
/* jshint boss:true */
|
40076
|
-
|
40077
39983
|
} while (elem = elem.parentNode);
|
40078
|
-
|
40079
39984
|
return getWindowScrollingElement();
|
40080
39985
|
}
|
40081
|
-
|
40082
39986
|
function extend(dst, src) {
|
40083
39987
|
if (dst && src) {
|
40084
39988
|
for (var key in src) {
|
@@ -40087,49 +39991,39 @@ function extend(dst, src) {
|
|
40087
39991
|
}
|
40088
39992
|
}
|
40089
39993
|
}
|
40090
|
-
|
40091
39994
|
return dst;
|
40092
39995
|
}
|
40093
|
-
|
40094
39996
|
function isRectEqual(rect1, rect2) {
|
40095
39997
|
return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
|
40096
39998
|
}
|
40097
|
-
|
40098
39999
|
var _throttleTimeout;
|
40099
|
-
|
40100
40000
|
function throttle$1(callback, ms) {
|
40101
40001
|
return function () {
|
40102
40002
|
if (!_throttleTimeout) {
|
40103
40003
|
var args = arguments,
|
40104
|
-
|
40105
|
-
|
40004
|
+
_this = this;
|
40106
40005
|
if (args.length === 1) {
|
40107
40006
|
callback.call(_this, args[0]);
|
40108
40007
|
} else {
|
40109
40008
|
callback.apply(_this, args);
|
40110
40009
|
}
|
40111
|
-
|
40112
40010
|
_throttleTimeout = setTimeout(function () {
|
40113
40011
|
_throttleTimeout = void 0;
|
40114
40012
|
}, ms);
|
40115
40013
|
}
|
40116
40014
|
};
|
40117
40015
|
}
|
40118
|
-
|
40119
40016
|
function cancelThrottle() {
|
40120
40017
|
clearTimeout(_throttleTimeout);
|
40121
40018
|
_throttleTimeout = void 0;
|
40122
40019
|
}
|
40123
|
-
|
40124
40020
|
function scrollBy(el, x, y) {
|
40125
40021
|
el.scrollLeft += x;
|
40126
40022
|
el.scrollTop += y;
|
40127
40023
|
}
|
40128
|
-
|
40129
40024
|
function clone(el) {
|
40130
40025
|
var Polymer = window.Polymer;
|
40131
40026
|
var $ = window.jQuery || window.Zepto;
|
40132
|
-
|
40133
40027
|
if (Polymer && Polymer.dom) {
|
40134
40028
|
return Polymer.dom(el).cloneNode(true);
|
40135
40029
|
} else if ($) {
|
@@ -40138,12 +40032,28 @@ function clone(el) {
|
|
40138
40032
|
return el.cloneNode(true);
|
40139
40033
|
}
|
40140
40034
|
}
|
40141
|
-
|
40035
|
+
function getChildContainingRectFromElement(container, options, ghostEl) {
|
40036
|
+
var rect = {};
|
40037
|
+
Array.from(container.children).forEach(function (child) {
|
40038
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
40039
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
|
40040
|
+
var childRect = getRect$1(child);
|
40041
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
40042
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
40043
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
40044
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
40045
|
+
});
|
40046
|
+
rect.width = rect.right - rect.left;
|
40047
|
+
rect.height = rect.bottom - rect.top;
|
40048
|
+
rect.x = rect.left;
|
40049
|
+
rect.y = rect.top;
|
40050
|
+
return rect;
|
40051
|
+
}
|
40142
40052
|
var expando = 'Sortable' + new Date().getTime();
|
40143
40053
|
|
40144
40054
|
function AnimationStateManager() {
|
40145
40055
|
var animationStates = [],
|
40146
|
-
|
40056
|
+
animationCallbackId;
|
40147
40057
|
return {
|
40148
40058
|
captureAnimationState: function captureAnimationState() {
|
40149
40059
|
animationStates = [];
|
@@ -40155,19 +40065,16 @@ function AnimationStateManager() {
|
|
40155
40065
|
target: child,
|
40156
40066
|
rect: getRect$1(child)
|
40157
40067
|
});
|
40068
|
+
var fromRect = _objectSpread2$1({}, animationStates[animationStates.length - 1].rect);
|
40158
40069
|
|
40159
|
-
|
40160
|
-
|
40161
|
-
|
40070
|
+
// If animating: compensate for current animation
|
40162
40071
|
if (child.thisAnimationDuration) {
|
40163
40072
|
var childMatrix = matrix(child, true);
|
40164
|
-
|
40165
40073
|
if (childMatrix) {
|
40166
40074
|
fromRect.top -= childMatrix.f;
|
40167
40075
|
fromRect.left -= childMatrix.e;
|
40168
40076
|
}
|
40169
40077
|
}
|
40170
|
-
|
40171
40078
|
child.fromRect = fromRect;
|
40172
40079
|
});
|
40173
40080
|
},
|
@@ -40181,54 +40088,47 @@ function AnimationStateManager() {
|
|
40181
40088
|
},
|
40182
40089
|
animateAll: function animateAll(callback) {
|
40183
40090
|
var _this = this;
|
40184
|
-
|
40185
40091
|
if (!this.options.animation) {
|
40186
40092
|
clearTimeout(animationCallbackId);
|
40187
40093
|
if (typeof callback === 'function') callback();
|
40188
40094
|
return;
|
40189
40095
|
}
|
40190
|
-
|
40191
40096
|
var animating = false,
|
40192
|
-
|
40097
|
+
animationTime = 0;
|
40193
40098
|
animationStates.forEach(function (state) {
|
40194
40099
|
var time = 0,
|
40195
|
-
|
40196
|
-
|
40197
|
-
|
40198
|
-
|
40199
|
-
|
40200
|
-
|
40201
|
-
|
40202
|
-
|
40100
|
+
target = state.target,
|
40101
|
+
fromRect = target.fromRect,
|
40102
|
+
toRect = getRect$1(target),
|
40103
|
+
prevFromRect = target.prevFromRect,
|
40104
|
+
prevToRect = target.prevToRect,
|
40105
|
+
animatingRect = state.rect,
|
40106
|
+
targetMatrix = matrix(target, true);
|
40203
40107
|
if (targetMatrix) {
|
40204
40108
|
// Compensate for current animation
|
40205
40109
|
toRect.top -= targetMatrix.f;
|
40206
40110
|
toRect.left -= targetMatrix.e;
|
40207
40111
|
}
|
40208
|
-
|
40209
40112
|
target.toRect = toRect;
|
40210
|
-
|
40211
40113
|
if (target.thisAnimationDuration) {
|
40212
40114
|
// Could also check if animatingRect is between fromRect and toRect
|
40213
|
-
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
40115
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
40116
|
+
// Make sure animatingRect is on line between toRect & fromRect
|
40214
40117
|
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
40215
40118
|
// If returning to same place as started from animation and on same axis
|
40216
40119
|
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
40217
40120
|
}
|
40218
|
-
}
|
40219
|
-
|
40121
|
+
}
|
40220
40122
|
|
40123
|
+
// if fromRect != toRect: animate
|
40221
40124
|
if (!isRectEqual(toRect, fromRect)) {
|
40222
40125
|
target.prevFromRect = fromRect;
|
40223
40126
|
target.prevToRect = toRect;
|
40224
|
-
|
40225
40127
|
if (!time) {
|
40226
40128
|
time = _this.options.animation;
|
40227
40129
|
}
|
40228
|
-
|
40229
40130
|
_this.animate(target, animatingRect, toRect, time);
|
40230
40131
|
}
|
40231
|
-
|
40232
40132
|
if (time) {
|
40233
40133
|
animating = true;
|
40234
40134
|
animationTime = Math.max(animationTime, time);
|
@@ -40244,7 +40144,6 @@ function AnimationStateManager() {
|
|
40244
40144
|
}
|
40245
40145
|
});
|
40246
40146
|
clearTimeout(animationCallbackId);
|
40247
|
-
|
40248
40147
|
if (!animating) {
|
40249
40148
|
if (typeof callback === 'function') callback();
|
40250
40149
|
} else {
|
@@ -40252,7 +40151,6 @@ function AnimationStateManager() {
|
|
40252
40151
|
if (typeof callback === 'function') callback();
|
40253
40152
|
}, animationTime);
|
40254
40153
|
}
|
40255
|
-
|
40256
40154
|
animationStates = [];
|
40257
40155
|
},
|
40258
40156
|
animate: function animate(target, currentRect, toRect, duration) {
|
@@ -40260,10 +40158,10 @@ function AnimationStateManager() {
|
|
40260
40158
|
css$2(target, 'transition', '');
|
40261
40159
|
css$2(target, 'transform', '');
|
40262
40160
|
var elMatrix = matrix(this.el),
|
40263
|
-
|
40264
|
-
|
40265
|
-
|
40266
|
-
|
40161
|
+
scaleX = elMatrix && elMatrix.a,
|
40162
|
+
scaleY = elMatrix && elMatrix.d,
|
40163
|
+
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
40164
|
+
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
40267
40165
|
target.animatingX = !!translateX;
|
40268
40166
|
target.animatingY = !!translateY;
|
40269
40167
|
css$2(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
@@ -40283,11 +40181,9 @@ function AnimationStateManager() {
|
|
40283
40181
|
}
|
40284
40182
|
};
|
40285
40183
|
}
|
40286
|
-
|
40287
40184
|
function repaint(target) {
|
40288
40185
|
return target.offsetWidth;
|
40289
40186
|
}
|
40290
|
-
|
40291
40187
|
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
40292
40188
|
return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
|
40293
40189
|
}
|
@@ -40304,7 +40200,6 @@ var PluginManager = {
|
|
40304
40200
|
plugin[option] = defaults[option];
|
40305
40201
|
}
|
40306
40202
|
}
|
40307
|
-
|
40308
40203
|
plugins.forEach(function (p) {
|
40309
40204
|
if (p.pluginName === plugin.pluginName) {
|
40310
40205
|
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
@@ -40314,25 +40209,22 @@ var PluginManager = {
|
|
40314
40209
|
},
|
40315
40210
|
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
40316
40211
|
var _this = this;
|
40317
|
-
|
40318
40212
|
this.eventCanceled = false;
|
40319
|
-
|
40320
40213
|
evt.cancel = function () {
|
40321
40214
|
_this.eventCanceled = true;
|
40322
40215
|
};
|
40323
|
-
|
40324
40216
|
var eventNameGlobal = eventName + 'Global';
|
40325
40217
|
plugins.forEach(function (plugin) {
|
40326
|
-
if (!sortable[plugin.pluginName]) return;
|
40327
|
-
|
40218
|
+
if (!sortable[plugin.pluginName]) return;
|
40219
|
+
// Fire global events if it exists in this sortable
|
40328
40220
|
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
40329
40221
|
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2$1({
|
40330
40222
|
sortable: sortable
|
40331
40223
|
}, evt));
|
40332
|
-
}
|
40333
|
-
// and plugin has event defined
|
40334
|
-
|
40224
|
+
}
|
40335
40225
|
|
40226
|
+
// Only fire plugin event if plugin is enabled in this sortable,
|
40227
|
+
// and plugin has event defined
|
40336
40228
|
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
40337
40229
|
sortable[plugin.pluginName][eventName](_objectSpread2$1({
|
40338
40230
|
sortable: sortable
|
@@ -40347,15 +40239,14 @@ var PluginManager = {
|
|
40347
40239
|
var initialized = new plugin(sortable, el, sortable.options);
|
40348
40240
|
initialized.sortable = sortable;
|
40349
40241
|
initialized.options = sortable.options;
|
40350
|
-
sortable[pluginName] = initialized;
|
40242
|
+
sortable[pluginName] = initialized;
|
40351
40243
|
|
40244
|
+
// Add default options from plugin
|
40352
40245
|
_extends(defaults, initialized.defaults);
|
40353
40246
|
});
|
40354
|
-
|
40355
40247
|
for (var option in sortable.options) {
|
40356
40248
|
if (!sortable.options.hasOwnProperty(option)) continue;
|
40357
40249
|
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
40358
|
-
|
40359
40250
|
if (typeof modified !== 'undefined') {
|
40360
40251
|
sortable.options[option] = modified;
|
40361
40252
|
}
|
@@ -40365,7 +40256,6 @@ var PluginManager = {
|
|
40365
40256
|
var eventProperties = {};
|
40366
40257
|
plugins.forEach(function (plugin) {
|
40367
40258
|
if (typeof plugin.eventProperties !== 'function') return;
|
40368
|
-
|
40369
40259
|
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
40370
40260
|
});
|
40371
40261
|
return eventProperties;
|
@@ -40374,8 +40264,9 @@ var PluginManager = {
|
|
40374
40264
|
var modifiedValue;
|
40375
40265
|
plugins.forEach(function (plugin) {
|
40376
40266
|
// Plugin must exist on the Sortable
|
40377
|
-
if (!sortable[plugin.pluginName]) return;
|
40267
|
+
if (!sortable[plugin.pluginName]) return;
|
40378
40268
|
|
40269
|
+
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
40379
40270
|
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
40380
40271
|
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
40381
40272
|
}
|
@@ -40386,25 +40277,25 @@ var PluginManager = {
|
|
40386
40277
|
|
40387
40278
|
function dispatchEvent$1(_ref) {
|
40388
40279
|
var sortable = _ref.sortable,
|
40389
|
-
|
40390
|
-
|
40391
|
-
|
40392
|
-
|
40393
|
-
|
40394
|
-
|
40395
|
-
|
40396
|
-
|
40397
|
-
|
40398
|
-
|
40399
|
-
|
40400
|
-
|
40401
|
-
|
40280
|
+
rootEl = _ref.rootEl,
|
40281
|
+
name = _ref.name,
|
40282
|
+
targetEl = _ref.targetEl,
|
40283
|
+
cloneEl = _ref.cloneEl,
|
40284
|
+
toEl = _ref.toEl,
|
40285
|
+
fromEl = _ref.fromEl,
|
40286
|
+
oldIndex = _ref.oldIndex,
|
40287
|
+
newIndex = _ref.newIndex,
|
40288
|
+
oldDraggableIndex = _ref.oldDraggableIndex,
|
40289
|
+
newDraggableIndex = _ref.newDraggableIndex,
|
40290
|
+
originalEvent = _ref.originalEvent,
|
40291
|
+
putSortable = _ref.putSortable,
|
40292
|
+
extraEventProperties = _ref.extraEventProperties;
|
40402
40293
|
sortable = sortable || rootEl && rootEl[expando];
|
40403
40294
|
if (!sortable) return;
|
40404
40295
|
var evt,
|
40405
|
-
|
40406
|
-
|
40407
|
-
|
40296
|
+
options = sortable.options,
|
40297
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
40298
|
+
// Support for new CustomEvent feature
|
40408
40299
|
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
40409
40300
|
evt = new CustomEvent(name, {
|
40410
40301
|
bubbles: true,
|
@@ -40414,7 +40305,6 @@ function dispatchEvent$1(_ref) {
|
|
40414
40305
|
evt = document.createEvent('Event');
|
40415
40306
|
evt.initEvent(name, true, true);
|
40416
40307
|
}
|
40417
|
-
|
40418
40308
|
evt.to = toEl || rootEl;
|
40419
40309
|
evt.from = fromEl || rootEl;
|
40420
40310
|
evt.item = targetEl || rootEl;
|
@@ -40425,29 +40315,23 @@ function dispatchEvent$1(_ref) {
|
|
40425
40315
|
evt.newDraggableIndex = newDraggableIndex;
|
40426
40316
|
evt.originalEvent = originalEvent;
|
40427
40317
|
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
40428
|
-
|
40429
40318
|
var allEventProperties = _objectSpread2$1(_objectSpread2$1({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
40430
|
-
|
40431
40319
|
for (var option in allEventProperties) {
|
40432
40320
|
evt[option] = allEventProperties[option];
|
40433
40321
|
}
|
40434
|
-
|
40435
40322
|
if (rootEl) {
|
40436
40323
|
rootEl.dispatchEvent(evt);
|
40437
40324
|
}
|
40438
|
-
|
40439
40325
|
if (options[onName]) {
|
40440
40326
|
options[onName].call(sortable, evt);
|
40441
40327
|
}
|
40442
40328
|
}
|
40443
40329
|
|
40444
40330
|
var _excluded = ["evt"];
|
40445
|
-
|
40446
40331
|
var pluginEvent = function pluginEvent(eventName, sortable) {
|
40447
40332
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
40448
|
-
|
40449
|
-
|
40450
|
-
|
40333
|
+
originalEvent = _ref.evt,
|
40334
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
40451
40335
|
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2$1({
|
40452
40336
|
dragEl: dragEl,
|
40453
40337
|
parentEl: parentEl,
|
@@ -40482,7 +40366,6 @@ var pluginEvent = function pluginEvent(eventName, sortable) {
|
|
40482
40366
|
}
|
40483
40367
|
}, data));
|
40484
40368
|
};
|
40485
|
-
|
40486
40369
|
function _dispatchEvent(info) {
|
40487
40370
|
dispatchEvent$1(_objectSpread2$1({
|
40488
40371
|
putSortable: putSortable,
|
@@ -40495,62 +40378,61 @@ function _dispatchEvent(info) {
|
|
40495
40378
|
newDraggableIndex: newDraggableIndex
|
40496
40379
|
}, info));
|
40497
40380
|
}
|
40498
|
-
|
40499
40381
|
var dragEl,
|
40500
|
-
|
40501
|
-
|
40502
|
-
|
40503
|
-
|
40504
|
-
|
40505
|
-
|
40506
|
-
|
40507
|
-
|
40508
|
-
|
40509
|
-
|
40510
|
-
|
40511
|
-
|
40512
|
-
|
40513
|
-
|
40514
|
-
|
40515
|
-
|
40516
|
-
|
40517
|
-
|
40518
|
-
|
40519
|
-
|
40520
|
-
|
40521
|
-
|
40522
|
-
|
40523
|
-
|
40524
|
-
|
40525
|
-
|
40526
|
-
|
40527
|
-
|
40528
|
-
|
40529
|
-
ghostRelativeParent,
|
40530
|
-
|
40531
|
-
|
40532
|
-
|
40533
|
-
|
40534
|
-
|
40382
|
+
parentEl,
|
40383
|
+
ghostEl,
|
40384
|
+
rootEl,
|
40385
|
+
nextEl,
|
40386
|
+
lastDownEl,
|
40387
|
+
cloneEl,
|
40388
|
+
cloneHidden,
|
40389
|
+
oldIndex,
|
40390
|
+
newIndex,
|
40391
|
+
oldDraggableIndex,
|
40392
|
+
newDraggableIndex,
|
40393
|
+
activeGroup,
|
40394
|
+
putSortable,
|
40395
|
+
awaitingDragStarted = false,
|
40396
|
+
ignoreNextClick = false,
|
40397
|
+
sortables = [],
|
40398
|
+
tapEvt,
|
40399
|
+
touchEvt,
|
40400
|
+
lastDx,
|
40401
|
+
lastDy,
|
40402
|
+
tapDistanceLeft,
|
40403
|
+
tapDistanceTop,
|
40404
|
+
moved,
|
40405
|
+
lastTarget,
|
40406
|
+
lastDirection,
|
40407
|
+
pastFirstInvertThresh = false,
|
40408
|
+
isCircumstantialInvert = false,
|
40409
|
+
targetMoveDistance,
|
40410
|
+
// For positioning ghost absolutely
|
40411
|
+
ghostRelativeParent,
|
40412
|
+
ghostRelativeParentInitialScroll = [],
|
40413
|
+
// (left, top)
|
40414
|
+
|
40415
|
+
_silent = false,
|
40416
|
+
savedInputChecked = [];
|
40535
40417
|
|
40418
|
+
/** @const */
|
40536
40419
|
var documentExists = typeof document !== 'undefined',
|
40537
|
-
|
40538
|
-
|
40539
|
-
|
40540
|
-
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
40541
|
-
|
40542
|
-
|
40543
|
-
|
40544
|
-
|
40545
|
-
|
40546
|
-
|
40547
|
-
|
40548
|
-
|
40549
|
-
|
40550
|
-
|
40551
|
-
|
40552
|
-
|
40553
|
-
var elCSS = css$2(el),
|
40420
|
+
PositionGhostAbsolutely = IOS,
|
40421
|
+
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
40422
|
+
// This will not pass for IE9, because IE9 DnD only works on anchors
|
40423
|
+
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
40424
|
+
supportCssPointerEvents = function () {
|
40425
|
+
if (!documentExists) return;
|
40426
|
+
// false when <= IE11
|
40427
|
+
if (IE11OrLess) {
|
40428
|
+
return false;
|
40429
|
+
}
|
40430
|
+
var el = document.createElement('x');
|
40431
|
+
el.style.cssText = 'pointer-events:auto';
|
40432
|
+
return el.style.pointerEvents === 'auto';
|
40433
|
+
}(),
|
40434
|
+
_detectDirection = function _detectDirection(el, options) {
|
40435
|
+
var elCSS = css$2(el),
|
40554
40436
|
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
40555
40437
|
child1 = getChild(el, 0, options),
|
40556
40438
|
child2 = getChild(el, 1, options),
|
@@ -40558,103 +40440,93 @@ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in
|
|
40558
40440
|
secondChildCSS = child2 && css$2(child2),
|
40559
40441
|
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect$1(child1).width,
|
40560
40442
|
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect$1(child2).width;
|
40561
|
-
|
40562
|
-
|
40563
|
-
|
40564
|
-
|
40565
|
-
|
40566
|
-
|
40567
|
-
|
40568
|
-
|
40569
|
-
|
40570
|
-
|
40571
|
-
|
40572
|
-
|
40573
|
-
|
40574
|
-
|
40575
|
-
return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
|
40576
|
-
},
|
40577
|
-
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
40578
|
-
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
40443
|
+
if (elCSS.display === 'flex') {
|
40444
|
+
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
40445
|
+
}
|
40446
|
+
if (elCSS.display === 'grid') {
|
40447
|
+
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
40448
|
+
}
|
40449
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
40450
|
+
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
40451
|
+
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
40452
|
+
}
|
40453
|
+
return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
|
40454
|
+
},
|
40455
|
+
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
40456
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
40579
40457
|
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
40580
40458
|
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
40581
40459
|
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
40582
40460
|
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
40583
40461
|
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
40584
|
-
|
40585
|
-
},
|
40586
|
-
|
40587
|
-
|
40588
|
-
|
40589
|
-
|
40590
|
-
|
40591
|
-
|
40592
|
-
|
40593
|
-
|
40594
|
-
|
40595
|
-
|
40596
|
-
|
40597
|
-
|
40598
|
-
var rect = getRect$1(sortable),
|
40462
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
40463
|
+
},
|
40464
|
+
/**
|
40465
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
40466
|
+
* @param {Number} x X position
|
40467
|
+
* @param {Number} y Y position
|
40468
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
40469
|
+
*/
|
40470
|
+
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
40471
|
+
var ret;
|
40472
|
+
sortables.some(function (sortable) {
|
40473
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
40474
|
+
if (!threshold || lastChild(sortable)) return;
|
40475
|
+
var rect = getRect$1(sortable),
|
40599
40476
|
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
40600
40477
|
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
40601
|
-
|
40602
|
-
|
40603
|
-
return ret = sortable;
|
40604
|
-
}
|
40605
|
-
});
|
40606
|
-
return ret;
|
40607
|
-
},
|
40608
|
-
_prepareGroup = function _prepareGroup(options) {
|
40609
|
-
function toFn(value, pull) {
|
40610
|
-
return function (to, from, dragEl, evt) {
|
40611
|
-
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
40612
|
-
|
40613
|
-
if (value == null && (pull || sameGroup)) {
|
40614
|
-
// Default pull value
|
40615
|
-
// Default pull and put value if same group
|
40616
|
-
return true;
|
40617
|
-
} else if (value == null || value === false) {
|
40618
|
-
return false;
|
40619
|
-
} else if (pull && value === 'clone') {
|
40620
|
-
return value;
|
40621
|
-
} else if (typeof value === 'function') {
|
40622
|
-
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
40623
|
-
} else {
|
40624
|
-
var otherGroup = (pull ? to : from).options.group.name;
|
40625
|
-
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
40478
|
+
if (insideHorizontally && insideVertically) {
|
40479
|
+
return ret = sortable;
|
40626
40480
|
}
|
40627
|
-
};
|
40628
|
-
|
40629
|
-
|
40630
|
-
|
40631
|
-
|
40632
|
-
|
40633
|
-
|
40634
|
-
|
40635
|
-
|
40636
|
-
|
40637
|
-
|
40638
|
-
|
40639
|
-
|
40640
|
-
|
40641
|
-
|
40642
|
-
|
40643
|
-
|
40644
|
-
}
|
40645
|
-
|
40646
|
-
|
40647
|
-
|
40648
|
-
|
40649
|
-
}
|
40650
|
-
|
40651
|
-
|
40652
|
-
|
40653
|
-
|
40654
|
-
|
40655
|
-
|
40481
|
+
});
|
40482
|
+
return ret;
|
40483
|
+
},
|
40484
|
+
_prepareGroup = function _prepareGroup(options) {
|
40485
|
+
function toFn(value, pull) {
|
40486
|
+
return function (to, from, dragEl, evt) {
|
40487
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
40488
|
+
if (value == null && (pull || sameGroup)) {
|
40489
|
+
// Default pull value
|
40490
|
+
// Default pull and put value if same group
|
40491
|
+
return true;
|
40492
|
+
} else if (value == null || value === false) {
|
40493
|
+
return false;
|
40494
|
+
} else if (pull && value === 'clone') {
|
40495
|
+
return value;
|
40496
|
+
} else if (typeof value === 'function') {
|
40497
|
+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
40498
|
+
} else {
|
40499
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
40500
|
+
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
40501
|
+
}
|
40502
|
+
};
|
40503
|
+
}
|
40504
|
+
var group = {};
|
40505
|
+
var originalGroup = options.group;
|
40506
|
+
if (!originalGroup || _typeof$1(originalGroup) != 'object') {
|
40507
|
+
originalGroup = {
|
40508
|
+
name: originalGroup
|
40509
|
+
};
|
40510
|
+
}
|
40511
|
+
group.name = originalGroup.name;
|
40512
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
40513
|
+
group.checkPut = toFn(originalGroup.put);
|
40514
|
+
group.revertClone = originalGroup.revertClone;
|
40515
|
+
options.group = group;
|
40516
|
+
},
|
40517
|
+
_hideGhostForTarget = function _hideGhostForTarget() {
|
40518
|
+
if (!supportCssPointerEvents && ghostEl) {
|
40519
|
+
css$2(ghostEl, 'display', 'none');
|
40520
|
+
}
|
40521
|
+
},
|
40522
|
+
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
40523
|
+
if (!supportCssPointerEvents && ghostEl) {
|
40524
|
+
css$2(ghostEl, 'display', '');
|
40525
|
+
}
|
40526
|
+
};
|
40656
40527
|
|
40657
|
-
if
|
40528
|
+
// #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
40529
|
+
if (documentExists && !ChromeForAndroid) {
|
40658
40530
|
document.addEventListener('click', function (evt) {
|
40659
40531
|
if (ignoreNextClick) {
|
40660
40532
|
evt.preventDefault();
|
@@ -40665,53 +40537,44 @@ if (documentExists) {
|
|
40665
40537
|
}
|
40666
40538
|
}, true);
|
40667
40539
|
}
|
40668
|
-
|
40669
40540
|
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
40670
40541
|
if (dragEl) {
|
40671
40542
|
evt = evt.touches ? evt.touches[0] : evt;
|
40672
|
-
|
40673
40543
|
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
40674
|
-
|
40675
40544
|
if (nearest) {
|
40676
40545
|
// Create imitation event
|
40677
40546
|
var event = {};
|
40678
|
-
|
40679
40547
|
for (var i in evt) {
|
40680
40548
|
if (evt.hasOwnProperty(i)) {
|
40681
40549
|
event[i] = evt[i];
|
40682
40550
|
}
|
40683
40551
|
}
|
40684
|
-
|
40685
40552
|
event.target = event.rootEl = nearest;
|
40686
40553
|
event.preventDefault = void 0;
|
40687
40554
|
event.stopPropagation = void 0;
|
40688
|
-
|
40689
40555
|
nearest[expando]._onDragOver(event);
|
40690
40556
|
}
|
40691
40557
|
}
|
40692
40558
|
};
|
40693
|
-
|
40694
40559
|
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
40695
40560
|
if (dragEl) {
|
40696
40561
|
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
40697
40562
|
}
|
40698
40563
|
};
|
40699
|
-
/**
|
40700
|
-
* @class Sortable
|
40701
|
-
* @param {HTMLElement} el
|
40702
|
-
* @param {Object} [options]
|
40703
|
-
*/
|
40704
|
-
|
40705
40564
|
|
40565
|
+
/**
|
40566
|
+
* @class Sortable
|
40567
|
+
* @param {HTMLElement} el
|
40568
|
+
* @param {Object} [options]
|
40569
|
+
*/
|
40706
40570
|
function Sortable(el, options) {
|
40707
40571
|
if (!(el && el.nodeType && el.nodeType === 1)) {
|
40708
40572
|
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
40709
40573
|
}
|
40710
|
-
|
40711
40574
|
this.el = el; // root element
|
40575
|
+
this.options = options = _extends({}, options);
|
40712
40576
|
|
40713
|
-
|
40714
|
-
|
40577
|
+
// Export instance
|
40715
40578
|
el[expando] = this;
|
40716
40579
|
var defaults = {
|
40717
40580
|
group: null,
|
@@ -40758,52 +40621,48 @@ function Sortable(el, options) {
|
|
40758
40621
|
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
|
40759
40622
|
emptyInsertThreshold: 5
|
40760
40623
|
};
|
40761
|
-
PluginManager.initializePlugins(this, el, defaults);
|
40624
|
+
PluginManager.initializePlugins(this, el, defaults);
|
40762
40625
|
|
40626
|
+
// Set default options
|
40763
40627
|
for (var name in defaults) {
|
40764
40628
|
!(name in options) && (options[name] = defaults[name]);
|
40765
40629
|
}
|
40630
|
+
_prepareGroup(options);
|
40766
40631
|
|
40767
|
-
|
40768
|
-
|
40769
|
-
|
40632
|
+
// Bind all private methods
|
40770
40633
|
for (var fn in this) {
|
40771
40634
|
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
40772
40635
|
this[fn] = this[fn].bind(this);
|
40773
40636
|
}
|
40774
|
-
}
|
40775
|
-
|
40637
|
+
}
|
40776
40638
|
|
40639
|
+
// Setup drag mode
|
40777
40640
|
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
40778
|
-
|
40779
40641
|
if (this.nativeDraggable) {
|
40780
40642
|
// Touch start threshold cannot be greater than the native dragstart threshold
|
40781
40643
|
this.options.touchStartThreshold = 1;
|
40782
|
-
}
|
40783
|
-
|
40644
|
+
}
|
40784
40645
|
|
40646
|
+
// Bind events
|
40785
40647
|
if (options.supportPointer) {
|
40786
40648
|
on(el, 'pointerdown', this._onTapStart);
|
40787
40649
|
} else {
|
40788
40650
|
on(el, 'mousedown', this._onTapStart);
|
40789
40651
|
on(el, 'touchstart', this._onTapStart);
|
40790
40652
|
}
|
40791
|
-
|
40792
40653
|
if (this.nativeDraggable) {
|
40793
40654
|
on(el, 'dragover', this);
|
40794
40655
|
on(el, 'dragenter', this);
|
40795
40656
|
}
|
40657
|
+
sortables.push(this.el);
|
40796
40658
|
|
40797
|
-
|
40798
|
-
|
40799
|
-
options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
|
40659
|
+
// Restore sorting
|
40660
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
40800
40661
|
|
40662
|
+
// Add animation state manager
|
40801
40663
|
_extends(this, AnimationStateManager());
|
40802
40664
|
}
|
40803
|
-
|
40804
|
-
Sortable.prototype =
|
40805
|
-
/** @lends Sortable.prototype */
|
40806
|
-
{
|
40665
|
+
Sortable.prototype = /** @lends Sortable.prototype */{
|
40807
40666
|
constructor: Sortable,
|
40808
40667
|
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
40809
40668
|
if (!this.el.contains(target) && target !== this.el) {
|
@@ -40813,57 +40672,50 @@ Sortable.prototype =
|
|
40813
40672
|
_getDirection: function _getDirection(evt, target) {
|
40814
40673
|
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
40815
40674
|
},
|
40816
|
-
_onTapStart: function _onTapStart(
|
40817
|
-
/** Event|TouchEvent */
|
40818
|
-
evt) {
|
40675
|
+
_onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
|
40819
40676
|
if (!evt.cancelable) return;
|
40820
|
-
|
40821
40677
|
var _this = this,
|
40822
|
-
|
40823
|
-
|
40824
|
-
|
40825
|
-
|
40826
|
-
|
40827
|
-
|
40828
|
-
|
40829
|
-
|
40830
|
-
|
40831
|
-
|
40832
|
-
|
40833
|
-
|
40678
|
+
el = this.el,
|
40679
|
+
options = this.options,
|
40680
|
+
preventOnFilter = options.preventOnFilter,
|
40681
|
+
type = evt.type,
|
40682
|
+
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
40683
|
+
target = (touch || evt).target,
|
40684
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
40685
|
+
filter = options.filter;
|
40686
|
+
_saveInputCheckedState(el);
|
40687
|
+
|
40688
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
40834
40689
|
if (dragEl) {
|
40835
40690
|
return;
|
40836
40691
|
}
|
40837
|
-
|
40838
40692
|
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
40839
40693
|
return; // only left button and enabled
|
40840
|
-
}
|
40841
|
-
|
40694
|
+
}
|
40842
40695
|
|
40696
|
+
// cancel dnd if original target is content editable
|
40843
40697
|
if (originalTarget.isContentEditable) {
|
40844
40698
|
return;
|
40845
|
-
}
|
40846
|
-
|
40699
|
+
}
|
40847
40700
|
|
40701
|
+
// Safari ignores further event handling after mousedown
|
40848
40702
|
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
40849
40703
|
return;
|
40850
40704
|
}
|
40851
|
-
|
40852
40705
|
target = closest(target, options.draggable, el, false);
|
40853
|
-
|
40854
40706
|
if (target && target.animated) {
|
40855
40707
|
return;
|
40856
40708
|
}
|
40857
|
-
|
40858
40709
|
if (lastDownEl === target) {
|
40859
40710
|
// Ignoring duplicate `down`
|
40860
40711
|
return;
|
40861
|
-
}
|
40862
|
-
|
40712
|
+
}
|
40863
40713
|
|
40714
|
+
// Get the index of the dragged element within its parent
|
40864
40715
|
oldIndex = index(target);
|
40865
|
-
oldDraggableIndex = index(target, options.draggable);
|
40716
|
+
oldDraggableIndex = index(target, options.draggable);
|
40866
40717
|
|
40718
|
+
// Check filter
|
40867
40719
|
if (typeof filter === 'function') {
|
40868
40720
|
if (filter.call(this, evt, target, this)) {
|
40869
40721
|
_dispatchEvent({
|
@@ -40874,7 +40726,6 @@ Sortable.prototype =
|
|
40874
40726
|
toEl: el,
|
40875
40727
|
fromEl: el
|
40876
40728
|
});
|
40877
|
-
|
40878
40729
|
pluginEvent('filter', _this, {
|
40879
40730
|
evt: evt
|
40880
40731
|
});
|
@@ -40884,7 +40735,6 @@ Sortable.prototype =
|
|
40884
40735
|
} else if (filter) {
|
40885
40736
|
filter = filter.split(',').some(function (criteria) {
|
40886
40737
|
criteria = closest(originalTarget, criteria.trim(), el, false);
|
40887
|
-
|
40888
40738
|
if (criteria) {
|
40889
40739
|
_dispatchEvent({
|
40890
40740
|
sortable: _this,
|
@@ -40894,40 +40744,30 @@ Sortable.prototype =
|
|
40894
40744
|
fromEl: el,
|
40895
40745
|
toEl: el
|
40896
40746
|
});
|
40897
|
-
|
40898
40747
|
pluginEvent('filter', _this, {
|
40899
40748
|
evt: evt
|
40900
40749
|
});
|
40901
40750
|
return true;
|
40902
40751
|
}
|
40903
40752
|
});
|
40904
|
-
|
40905
40753
|
if (filter) {
|
40906
40754
|
preventOnFilter && evt.cancelable && evt.preventDefault();
|
40907
40755
|
return; // cancel dnd
|
40908
40756
|
}
|
40909
40757
|
}
|
40910
|
-
|
40911
40758
|
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
40912
40759
|
return;
|
40913
|
-
}
|
40914
|
-
|
40760
|
+
}
|
40915
40761
|
|
40762
|
+
// Prepare `dragstart`
|
40916
40763
|
this._prepareDragStart(evt, touch, target);
|
40917
40764
|
},
|
40918
|
-
_prepareDragStart: function _prepareDragStart(
|
40919
|
-
/** Event */
|
40920
|
-
evt,
|
40921
|
-
/** Touch */
|
40922
|
-
touch,
|
40923
|
-
/** HTMLElement */
|
40924
|
-
target) {
|
40765
|
+
_prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
|
40925
40766
|
var _this = this,
|
40926
|
-
|
40927
|
-
|
40928
|
-
|
40929
|
-
|
40930
|
-
|
40767
|
+
el = _this.el,
|
40768
|
+
options = _this.options,
|
40769
|
+
ownerDocument = el.ownerDocument,
|
40770
|
+
dragStartFn;
|
40931
40771
|
if (target && !dragEl && target.parentNode === el) {
|
40932
40772
|
var dragRect = getRect$1(target);
|
40933
40773
|
rootEl = el;
|
@@ -40947,41 +40787,36 @@ Sortable.prototype =
|
|
40947
40787
|
this._lastX = (touch || evt).clientX;
|
40948
40788
|
this._lastY = (touch || evt).clientY;
|
40949
40789
|
dragEl.style['will-change'] = 'all';
|
40950
|
-
|
40951
40790
|
dragStartFn = function dragStartFn() {
|
40952
40791
|
pluginEvent('delayEnded', _this, {
|
40953
40792
|
evt: evt
|
40954
40793
|
});
|
40955
|
-
|
40956
40794
|
if (Sortable.eventCanceled) {
|
40957
40795
|
_this._onDrop();
|
40958
|
-
|
40959
40796
|
return;
|
40960
|
-
}
|
40797
|
+
}
|
40798
|
+
// Delayed drag has been triggered
|
40961
40799
|
// we can re-enable the events: touchmove/mousemove
|
40962
|
-
|
40963
|
-
|
40964
40800
|
_this._disableDelayedDragEvents();
|
40965
|
-
|
40966
40801
|
if (!FireFox && _this.nativeDraggable) {
|
40967
40802
|
dragEl.draggable = true;
|
40968
|
-
}
|
40969
|
-
|
40970
|
-
|
40971
|
-
_this._triggerDragStart(evt, touch); // Drag start event
|
40803
|
+
}
|
40972
40804
|
|
40805
|
+
// Bind the events: dragstart/dragend
|
40806
|
+
_this._triggerDragStart(evt, touch);
|
40973
40807
|
|
40808
|
+
// Drag start event
|
40974
40809
|
_dispatchEvent({
|
40975
40810
|
sortable: _this,
|
40976
40811
|
name: 'choose',
|
40977
40812
|
originalEvent: evt
|
40978
|
-
});
|
40979
|
-
|
40813
|
+
});
|
40980
40814
|
|
40815
|
+
// Chosen item
|
40981
40816
|
toggleClass$1(dragEl, options.chosenClass, true);
|
40982
|
-
};
|
40983
|
-
|
40817
|
+
};
|
40984
40818
|
|
40819
|
+
// Disable "draggable"
|
40985
40820
|
options.ignore.split(',').forEach(function (criteria) {
|
40986
40821
|
find$2(dragEl, criteria.trim(), _disableDraggable);
|
40987
40822
|
});
|
@@ -40990,27 +40825,26 @@ Sortable.prototype =
|
|
40990
40825
|
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
40991
40826
|
on(ownerDocument, 'mouseup', _this._onDrop);
|
40992
40827
|
on(ownerDocument, 'touchend', _this._onDrop);
|
40993
|
-
on(ownerDocument, 'touchcancel', _this._onDrop);
|
40828
|
+
on(ownerDocument, 'touchcancel', _this._onDrop);
|
40994
40829
|
|
40830
|
+
// Make dragEl draggable (must be before delay for FireFox)
|
40995
40831
|
if (FireFox && this.nativeDraggable) {
|
40996
40832
|
this.options.touchStartThreshold = 4;
|
40997
40833
|
dragEl.draggable = true;
|
40998
40834
|
}
|
40999
|
-
|
41000
40835
|
pluginEvent('delayStart', this, {
|
41001
40836
|
evt: evt
|
41002
|
-
});
|
40837
|
+
});
|
41003
40838
|
|
40839
|
+
// Delay is impossible for native DnD in Edge or IE
|
41004
40840
|
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
41005
40841
|
if (Sortable.eventCanceled) {
|
41006
40842
|
this._onDrop();
|
41007
|
-
|
41008
40843
|
return;
|
41009
|
-
}
|
40844
|
+
}
|
40845
|
+
// If the user moves the pointer or let go the click or touch
|
41010
40846
|
// before the delay has been reached:
|
41011
40847
|
// disable the delayed drag
|
41012
|
-
|
41013
|
-
|
41014
40848
|
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
41015
40849
|
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
41016
40850
|
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
@@ -41023,11 +40857,8 @@ Sortable.prototype =
|
|
41023
40857
|
}
|
41024
40858
|
}
|
41025
40859
|
},
|
41026
|
-
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
|
41027
|
-
/** TouchEvent|PointerEvent **/
|
41028
|
-
e) {
|
40860
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
|
41029
40861
|
var touch = e.touches ? e.touches[0] : e;
|
41030
|
-
|
41031
40862
|
if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
|
41032
40863
|
this._disableDelayedDrag();
|
41033
40864
|
}
|
@@ -41035,7 +40866,6 @@ Sortable.prototype =
|
|
41035
40866
|
_disableDelayedDrag: function _disableDelayedDrag() {
|
41036
40867
|
dragEl && _disableDraggable(dragEl);
|
41037
40868
|
clearTimeout(this._dragStartTimer);
|
41038
|
-
|
41039
40869
|
this._disableDelayedDragEvents();
|
41040
40870
|
},
|
41041
40871
|
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
@@ -41047,13 +40877,8 @@ Sortable.prototype =
|
|
41047
40877
|
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
41048
40878
|
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
41049
40879
|
},
|
41050
|
-
_triggerDragStart: function _triggerDragStart(
|
41051
|
-
/** Event */
|
41052
|
-
evt,
|
41053
|
-
/** Touch */
|
41054
|
-
touch) {
|
40880
|
+
_triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
|
41055
40881
|
touch = touch || evt.pointerType == 'touch' && evt;
|
41056
|
-
|
41057
40882
|
if (!this.nativeDraggable || touch) {
|
41058
40883
|
if (this.options.supportPointer) {
|
41059
40884
|
on(document, 'pointermove', this._onTouchMove);
|
@@ -41066,7 +40891,6 @@ Sortable.prototype =
|
|
41066
40891
|
on(dragEl, 'dragend', this);
|
41067
40892
|
on(rootEl, 'dragstart', this._onDragStart);
|
41068
40893
|
}
|
41069
|
-
|
41070
40894
|
try {
|
41071
40895
|
if (document.selection) {
|
41072
40896
|
// Timeout neccessary for IE9
|
@@ -41079,25 +40903,23 @@ Sortable.prototype =
|
|
41079
40903
|
} catch (err) {}
|
41080
40904
|
},
|
41081
40905
|
_dragStarted: function _dragStarted(fallback, evt) {
|
41082
|
-
|
41083
40906
|
awaitingDragStarted = false;
|
41084
|
-
|
41085
40907
|
if (rootEl && dragEl) {
|
41086
40908
|
pluginEvent('dragStarted', this, {
|
41087
40909
|
evt: evt
|
41088
40910
|
});
|
41089
|
-
|
41090
40911
|
if (this.nativeDraggable) {
|
41091
40912
|
on(document, 'dragover', _checkOutsideTargetEl);
|
41092
40913
|
}
|
40914
|
+
var options = this.options;
|
41093
40915
|
|
41094
|
-
|
41095
|
-
|
40916
|
+
// Apply effect
|
41096
40917
|
!fallback && toggleClass$1(dragEl, options.dragClass, false);
|
41097
40918
|
toggleClass$1(dragEl, options.ghostClass, true);
|
41098
40919
|
Sortable.active = this;
|
41099
|
-
fallback && this._appendGhost();
|
40920
|
+
fallback && this._appendGhost();
|
41100
40921
|
|
40922
|
+
// Drag start event
|
41101
40923
|
_dispatchEvent({
|
41102
40924
|
sortable: this,
|
41103
40925
|
name: 'start',
|
@@ -41111,20 +40933,15 @@ Sortable.prototype =
|
|
41111
40933
|
if (touchEvt) {
|
41112
40934
|
this._lastX = touchEvt.clientX;
|
41113
40935
|
this._lastY = touchEvt.clientY;
|
41114
|
-
|
41115
40936
|
_hideGhostForTarget();
|
41116
|
-
|
41117
40937
|
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
41118
40938
|
var parent = target;
|
41119
|
-
|
41120
40939
|
while (target && target.shadowRoot) {
|
41121
40940
|
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
41122
40941
|
if (target === parent) break;
|
41123
40942
|
parent = target;
|
41124
40943
|
}
|
41125
|
-
|
41126
40944
|
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
41127
|
-
|
41128
40945
|
if (parent) {
|
41129
40946
|
do {
|
41130
40947
|
if (parent[expando]) {
|
@@ -41135,44 +40952,37 @@ Sortable.prototype =
|
|
41135
40952
|
target: target,
|
41136
40953
|
rootEl: parent
|
41137
40954
|
});
|
41138
|
-
|
41139
40955
|
if (inserted && !this.options.dragoverBubble) {
|
41140
40956
|
break;
|
41141
40957
|
}
|
41142
40958
|
}
|
41143
|
-
|
41144
40959
|
target = parent; // store last element
|
41145
40960
|
}
|
41146
|
-
/* jshint boss:true */
|
41147
|
-
while (parent = parent.parentNode);
|
40961
|
+
/* jshint boss:true */ while (parent = parent.parentNode);
|
41148
40962
|
}
|
41149
|
-
|
41150
40963
|
_unhideGhostForTarget();
|
41151
40964
|
}
|
41152
40965
|
},
|
41153
|
-
_onTouchMove: function _onTouchMove(
|
41154
|
-
/**TouchEvent*/
|
41155
|
-
evt) {
|
40966
|
+
_onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
|
41156
40967
|
if (tapEvt) {
|
41157
40968
|
var options = this.options,
|
41158
|
-
|
41159
|
-
|
41160
|
-
|
41161
|
-
|
41162
|
-
|
41163
|
-
|
41164
|
-
|
41165
|
-
|
41166
|
-
|
41167
|
-
|
40969
|
+
fallbackTolerance = options.fallbackTolerance,
|
40970
|
+
fallbackOffset = options.fallbackOffset,
|
40971
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
40972
|
+
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
40973
|
+
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
40974
|
+
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
40975
|
+
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
40976
|
+
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
40977
|
+
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
40978
|
+
|
40979
|
+
// only set the status to dragging, when we are actually dragging
|
41168
40980
|
if (!Sortable.active && !awaitingDragStarted) {
|
41169
40981
|
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
41170
40982
|
return;
|
41171
40983
|
}
|
41172
|
-
|
41173
40984
|
this._onDragStart(evt, true);
|
41174
40985
|
}
|
41175
|
-
|
41176
40986
|
if (ghostEl) {
|
41177
40987
|
if (ghostMatrix) {
|
41178
40988
|
ghostMatrix.e += dx - (lastDx || 0);
|
@@ -41187,7 +40997,6 @@ Sortable.prototype =
|
|
41187
40997
|
f: dy
|
41188
40998
|
};
|
41189
40999
|
}
|
41190
|
-
|
41191
41000
|
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
41192
41001
|
css$2(ghostEl, 'webkitTransform', cssMatrix);
|
41193
41002
|
css$2(ghostEl, 'mozTransform', cssMatrix);
|
@@ -41197,7 +41006,6 @@ Sortable.prototype =
|
|
41197
41006
|
lastDy = dy;
|
41198
41007
|
touchEvt = touch;
|
41199
41008
|
}
|
41200
|
-
|
41201
41009
|
evt.cancelable && evt.preventDefault();
|
41202
41010
|
}
|
41203
41011
|
},
|
@@ -41206,17 +41014,16 @@ Sortable.prototype =
|
|
41206
41014
|
// Not being adjusted for
|
41207
41015
|
if (!ghostEl) {
|
41208
41016
|
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
41209
|
-
|
41210
|
-
|
41017
|
+
rect = getRect$1(dragEl, true, PositionGhostAbsolutely, true, container),
|
41018
|
+
options = this.options;
|
41211
41019
|
|
41020
|
+
// Position absolutely
|
41212
41021
|
if (PositionGhostAbsolutely) {
|
41213
41022
|
// Get relatively positioned parent
|
41214
41023
|
ghostRelativeParent = container;
|
41215
|
-
|
41216
41024
|
while (css$2(ghostRelativeParent, 'position') === 'static' && css$2(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
41217
41025
|
ghostRelativeParent = ghostRelativeParent.parentNode;
|
41218
41026
|
}
|
41219
|
-
|
41220
41027
|
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
41221
41028
|
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
41222
41029
|
rect.top += ghostRelativeParent.scrollTop;
|
@@ -41224,10 +41031,8 @@ Sortable.prototype =
|
|
41224
41031
|
} else {
|
41225
41032
|
ghostRelativeParent = getWindowScrollingElement();
|
41226
41033
|
}
|
41227
|
-
|
41228
41034
|
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
41229
41035
|
}
|
41230
|
-
|
41231
41036
|
ghostEl = dragEl.cloneNode(true);
|
41232
41037
|
toggleClass$1(ghostEl, options.ghostClass, false);
|
41233
41038
|
toggleClass$1(ghostEl, options.fallbackClass, true);
|
@@ -41245,61 +41050,50 @@ Sortable.prototype =
|
|
41245
41050
|
css$2(ghostEl, 'zIndex', '100000');
|
41246
41051
|
css$2(ghostEl, 'pointerEvents', 'none');
|
41247
41052
|
Sortable.ghost = ghostEl;
|
41248
|
-
container.appendChild(ghostEl);
|
41053
|
+
container.appendChild(ghostEl);
|
41249
41054
|
|
41055
|
+
// Set transform-origin
|
41250
41056
|
css$2(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
41251
41057
|
}
|
41252
41058
|
},
|
41253
|
-
_onDragStart: function _onDragStart(
|
41254
|
-
/**Event*/
|
41255
|
-
evt,
|
41256
|
-
/**boolean*/
|
41257
|
-
fallback) {
|
41059
|
+
_onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
|
41258
41060
|
var _this = this;
|
41259
|
-
|
41260
41061
|
var dataTransfer = evt.dataTransfer;
|
41261
41062
|
var options = _this.options;
|
41262
41063
|
pluginEvent('dragStart', this, {
|
41263
41064
|
evt: evt
|
41264
41065
|
});
|
41265
|
-
|
41266
41066
|
if (Sortable.eventCanceled) {
|
41267
41067
|
this._onDrop();
|
41268
|
-
|
41269
41068
|
return;
|
41270
41069
|
}
|
41271
|
-
|
41272
41070
|
pluginEvent('setupClone', this);
|
41273
|
-
|
41274
41071
|
if (!Sortable.eventCanceled) {
|
41275
41072
|
cloneEl = clone(dragEl);
|
41073
|
+
cloneEl.removeAttribute("id");
|
41276
41074
|
cloneEl.draggable = false;
|
41277
41075
|
cloneEl.style['will-change'] = '';
|
41278
|
-
|
41279
41076
|
this._hideClone();
|
41280
|
-
|
41281
41077
|
toggleClass$1(cloneEl, this.options.chosenClass, false);
|
41282
41078
|
Sortable.clone = cloneEl;
|
41283
|
-
}
|
41284
|
-
|
41079
|
+
}
|
41285
41080
|
|
41081
|
+
// #1143: IFrame support workaround
|
41286
41082
|
_this.cloneId = _nextTick(function () {
|
41287
41083
|
pluginEvent('clone', _this);
|
41288
41084
|
if (Sortable.eventCanceled) return;
|
41289
|
-
|
41290
41085
|
if (!_this.options.removeCloneOnHide) {
|
41291
41086
|
rootEl.insertBefore(cloneEl, dragEl);
|
41292
41087
|
}
|
41293
|
-
|
41294
41088
|
_this._hideClone();
|
41295
|
-
|
41296
41089
|
_dispatchEvent({
|
41297
41090
|
sortable: _this,
|
41298
41091
|
name: 'clone'
|
41299
41092
|
});
|
41300
41093
|
});
|
41301
|
-
!fallback && toggleClass$1(dragEl, options.dragClass, true);
|
41094
|
+
!fallback && toggleClass$1(dragEl, options.dragClass, true);
|
41302
41095
|
|
41096
|
+
// Set proper drop events
|
41303
41097
|
if (fallback) {
|
41304
41098
|
ignoreNextClick = true;
|
41305
41099
|
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
@@ -41308,47 +41102,40 @@ Sortable.prototype =
|
|
41308
41102
|
off(document, 'mouseup', _this._onDrop);
|
41309
41103
|
off(document, 'touchend', _this._onDrop);
|
41310
41104
|
off(document, 'touchcancel', _this._onDrop);
|
41311
|
-
|
41312
41105
|
if (dataTransfer) {
|
41313
41106
|
dataTransfer.effectAllowed = 'move';
|
41314
41107
|
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
41315
41108
|
}
|
41109
|
+
on(document, 'drop', _this);
|
41316
41110
|
|
41317
|
-
|
41318
|
-
|
41111
|
+
// #1276 fix:
|
41319
41112
|
css$2(dragEl, 'transform', 'translateZ(0)');
|
41320
41113
|
}
|
41321
|
-
|
41322
41114
|
awaitingDragStarted = true;
|
41323
41115
|
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
41324
41116
|
on(document, 'selectstart', _this);
|
41325
41117
|
moved = true;
|
41326
|
-
|
41327
41118
|
if (Safari) {
|
41328
41119
|
css$2(document.body, 'user-select', 'none');
|
41329
41120
|
}
|
41330
41121
|
},
|
41331
41122
|
// Returns true - if no further action is needed (either inserted or another condition)
|
41332
|
-
_onDragOver: function _onDragOver(
|
41333
|
-
/**Event*/
|
41334
|
-
evt) {
|
41123
|
+
_onDragOver: function _onDragOver( /**Event*/evt) {
|
41335
41124
|
var el = this.el,
|
41336
|
-
|
41337
|
-
|
41338
|
-
|
41339
|
-
|
41340
|
-
|
41341
|
-
|
41342
|
-
|
41343
|
-
|
41344
|
-
|
41345
|
-
|
41346
|
-
|
41347
|
-
|
41348
|
-
|
41349
|
-
|
41125
|
+
target = evt.target,
|
41126
|
+
dragRect,
|
41127
|
+
targetRect,
|
41128
|
+
revert,
|
41129
|
+
options = this.options,
|
41130
|
+
group = options.group,
|
41131
|
+
activeSortable = Sortable.active,
|
41132
|
+
isOwner = activeGroup === group,
|
41133
|
+
canSort = options.sort,
|
41134
|
+
fromSortable = putSortable || activeSortable,
|
41135
|
+
vertical,
|
41136
|
+
_this = this,
|
41137
|
+
completedFired = false;
|
41350
41138
|
if (_silent) return;
|
41351
|
-
|
41352
41139
|
function dragOverEvent(name, extra) {
|
41353
41140
|
pluginEvent(name, _this, _objectSpread2$1({
|
41354
41141
|
evt: evt,
|
@@ -41366,25 +41153,22 @@ Sortable.prototype =
|
|
41366
41153
|
},
|
41367
41154
|
changed: changed
|
41368
41155
|
}, extra));
|
41369
|
-
}
|
41370
|
-
|
41156
|
+
}
|
41371
41157
|
|
41158
|
+
// Capture animation state
|
41372
41159
|
function capture() {
|
41373
41160
|
dragOverEvent('dragOverAnimationCapture');
|
41374
|
-
|
41375
41161
|
_this.captureAnimationState();
|
41376
|
-
|
41377
41162
|
if (_this !== fromSortable) {
|
41378
41163
|
fromSortable.captureAnimationState();
|
41379
41164
|
}
|
41380
|
-
}
|
41381
|
-
|
41165
|
+
}
|
41382
41166
|
|
41167
|
+
// Return invocation when dragEl is inserted (or completed)
|
41383
41168
|
function completed(insertion) {
|
41384
41169
|
dragOverEvent('dragOverCompleted', {
|
41385
41170
|
insertion: insertion
|
41386
41171
|
});
|
41387
|
-
|
41388
41172
|
if (insertion) {
|
41389
41173
|
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
41390
41174
|
if (isOwner) {
|
@@ -41392,57 +41176,51 @@ Sortable.prototype =
|
|
41392
41176
|
} else {
|
41393
41177
|
activeSortable._showClone(_this);
|
41394
41178
|
}
|
41395
|
-
|
41396
41179
|
if (_this !== fromSortable) {
|
41397
41180
|
// Set ghost class to new sortable's ghost class
|
41398
41181
|
toggleClass$1(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
41399
41182
|
toggleClass$1(dragEl, options.ghostClass, true);
|
41400
41183
|
}
|
41401
|
-
|
41402
41184
|
if (putSortable !== _this && _this !== Sortable.active) {
|
41403
41185
|
putSortable = _this;
|
41404
41186
|
} else if (_this === Sortable.active && putSortable) {
|
41405
41187
|
putSortable = null;
|
41406
|
-
}
|
41407
|
-
|
41188
|
+
}
|
41408
41189
|
|
41190
|
+
// Animation
|
41409
41191
|
if (fromSortable === _this) {
|
41410
41192
|
_this._ignoreWhileAnimating = target;
|
41411
41193
|
}
|
41412
|
-
|
41413
41194
|
_this.animateAll(function () {
|
41414
41195
|
dragOverEvent('dragOverAnimationComplete');
|
41415
41196
|
_this._ignoreWhileAnimating = null;
|
41416
41197
|
});
|
41417
|
-
|
41418
41198
|
if (_this !== fromSortable) {
|
41419
41199
|
fromSortable.animateAll();
|
41420
41200
|
fromSortable._ignoreWhileAnimating = null;
|
41421
41201
|
}
|
41422
|
-
}
|
41423
|
-
|
41202
|
+
}
|
41424
41203
|
|
41204
|
+
// Null lastTarget if it is not inside a previously swapped element
|
41425
41205
|
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
41426
41206
|
lastTarget = null;
|
41427
|
-
}
|
41428
|
-
|
41207
|
+
}
|
41429
41208
|
|
41209
|
+
// no bubbling and not fallback
|
41430
41210
|
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
41431
|
-
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
41432
|
-
|
41211
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
41433
41212
|
|
41213
|
+
// Do not detect for empty insert if already inserted
|
41434
41214
|
!insertion && nearestEmptyInsertDetectEvent(evt);
|
41435
41215
|
}
|
41436
|
-
|
41437
41216
|
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
41438
41217
|
return completedFired = true;
|
41439
|
-
}
|
41440
|
-
|
41218
|
+
}
|
41441
41219
|
|
41220
|
+
// Call when dragEl has been inserted
|
41442
41221
|
function changed() {
|
41443
41222
|
newIndex = index(dragEl);
|
41444
41223
|
newDraggableIndex = index(dragEl, options.draggable);
|
41445
|
-
|
41446
41224
|
_dispatchEvent({
|
41447
41225
|
sortable: _this,
|
41448
41226
|
name: 'change',
|
@@ -41452,37 +41230,27 @@ Sortable.prototype =
|
|
41452
41230
|
originalEvent: evt
|
41453
41231
|
});
|
41454
41232
|
}
|
41455
|
-
|
41456
41233
|
if (evt.preventDefault !== void 0) {
|
41457
41234
|
evt.cancelable && evt.preventDefault();
|
41458
41235
|
}
|
41459
|
-
|
41460
41236
|
target = closest(target, options.draggable, el, true);
|
41461
41237
|
dragOverEvent('dragOver');
|
41462
41238
|
if (Sortable.eventCanceled) return completedFired;
|
41463
|
-
|
41464
41239
|
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
41465
41240
|
return completed(false);
|
41466
41241
|
}
|
41467
|
-
|
41468
41242
|
ignoreNextClick = false;
|
41469
|
-
|
41470
41243
|
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
41471
41244
|
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
41472
41245
|
vertical = this._getDirection(evt, target) === 'vertical';
|
41473
41246
|
dragRect = getRect$1(dragEl);
|
41474
41247
|
dragOverEvent('dragOverValid');
|
41475
41248
|
if (Sortable.eventCanceled) return completedFired;
|
41476
|
-
|
41477
41249
|
if (revert) {
|
41478
41250
|
parentEl = rootEl; // actualization
|
41479
|
-
|
41480
41251
|
capture();
|
41481
|
-
|
41482
41252
|
this._hideClone();
|
41483
|
-
|
41484
41253
|
dragOverEvent('revert');
|
41485
|
-
|
41486
41254
|
if (!Sortable.eventCanceled) {
|
41487
41255
|
if (nextEl) {
|
41488
41256
|
rootEl.insertBefore(dragEl, nextEl);
|
@@ -41490,31 +41258,32 @@ Sortable.prototype =
|
|
41490
41258
|
rootEl.appendChild(dragEl);
|
41491
41259
|
}
|
41492
41260
|
}
|
41493
|
-
|
41494
41261
|
return completed(true);
|
41495
41262
|
}
|
41496
|
-
|
41497
41263
|
var elLastChild = lastChild(el, options.draggable);
|
41498
|
-
|
41499
41264
|
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
41500
41265
|
// Insert to end of list
|
41266
|
+
|
41501
41267
|
// If already at end of list: Do not insert
|
41502
41268
|
if (elLastChild === dragEl) {
|
41503
41269
|
return completed(false);
|
41504
|
-
}
|
41505
|
-
|
41270
|
+
}
|
41506
41271
|
|
41272
|
+
// if there is a last element, it is the target
|
41507
41273
|
if (elLastChild && el === evt.target) {
|
41508
41274
|
target = elLastChild;
|
41509
41275
|
}
|
41510
|
-
|
41511
41276
|
if (target) {
|
41512
41277
|
targetRect = getRect$1(target);
|
41513
41278
|
}
|
41514
|
-
|
41515
41279
|
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
41516
41280
|
capture();
|
41517
|
-
|
41281
|
+
if (elLastChild && elLastChild.nextSibling) {
|
41282
|
+
// the last draggable element is not the last node
|
41283
|
+
el.insertBefore(dragEl, elLastChild.nextSibling);
|
41284
|
+
} else {
|
41285
|
+
el.appendChild(dragEl);
|
41286
|
+
}
|
41518
41287
|
parentEl = el; // actualization
|
41519
41288
|
|
41520
41289
|
changed();
|
@@ -41523,14 +41292,11 @@ Sortable.prototype =
|
|
41523
41292
|
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
41524
41293
|
// Insert to start of list
|
41525
41294
|
var firstChild = getChild(el, 0, options, true);
|
41526
|
-
|
41527
41295
|
if (firstChild === dragEl) {
|
41528
41296
|
return completed(false);
|
41529
41297
|
}
|
41530
|
-
|
41531
41298
|
target = firstChild;
|
41532
41299
|
targetRect = getRect$1(target);
|
41533
|
-
|
41534
41300
|
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
41535
41301
|
capture();
|
41536
41302
|
el.insertBefore(dragEl, firstChild);
|
@@ -41542,82 +41308,68 @@ Sortable.prototype =
|
|
41542
41308
|
} else if (target.parentNode === el) {
|
41543
41309
|
targetRect = getRect$1(target);
|
41544
41310
|
var direction = 0,
|
41545
|
-
|
41546
|
-
|
41547
|
-
|
41548
|
-
|
41549
|
-
|
41550
|
-
|
41551
|
-
|
41311
|
+
targetBeforeFirstSwap,
|
41312
|
+
differentLevel = dragEl.parentNode !== el,
|
41313
|
+
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
41314
|
+
side1 = vertical ? 'top' : 'left',
|
41315
|
+
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
41316
|
+
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
41552
41317
|
if (lastTarget !== target) {
|
41553
41318
|
targetBeforeFirstSwap = targetRect[side1];
|
41554
41319
|
pastFirstInvertThresh = false;
|
41555
41320
|
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
41556
41321
|
}
|
41557
|
-
|
41558
41322
|
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
41559
41323
|
var sibling;
|
41560
|
-
|
41561
41324
|
if (direction !== 0) {
|
41562
41325
|
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
41563
41326
|
var dragIndex = index(dragEl);
|
41564
|
-
|
41565
41327
|
do {
|
41566
41328
|
dragIndex -= direction;
|
41567
41329
|
sibling = parentEl.children[dragIndex];
|
41568
41330
|
} while (sibling && (css$2(sibling, 'display') === 'none' || sibling === ghostEl));
|
41569
|
-
}
|
41570
|
-
|
41571
|
-
|
41331
|
+
}
|
41332
|
+
// If dragEl is already beside target: Do not insert
|
41572
41333
|
if (direction === 0 || sibling === target) {
|
41573
41334
|
return completed(false);
|
41574
41335
|
}
|
41575
|
-
|
41576
41336
|
lastTarget = target;
|
41577
41337
|
lastDirection = direction;
|
41578
41338
|
var nextSibling = target.nextElementSibling,
|
41579
|
-
|
41339
|
+
after = false;
|
41580
41340
|
after = direction === 1;
|
41581
|
-
|
41582
41341
|
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
41583
|
-
|
41584
41342
|
if (moveVector !== false) {
|
41585
41343
|
if (moveVector === 1 || moveVector === -1) {
|
41586
41344
|
after = moveVector === 1;
|
41587
41345
|
}
|
41588
|
-
|
41589
41346
|
_silent = true;
|
41590
41347
|
setTimeout(_unsilent, 30);
|
41591
41348
|
capture();
|
41592
|
-
|
41593
41349
|
if (after && !nextSibling) {
|
41594
41350
|
el.appendChild(dragEl);
|
41595
41351
|
} else {
|
41596
41352
|
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
41597
|
-
}
|
41598
|
-
|
41353
|
+
}
|
41599
41354
|
|
41355
|
+
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
41600
41356
|
if (scrolledPastTop) {
|
41601
41357
|
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
41602
41358
|
}
|
41603
|
-
|
41604
41359
|
parentEl = dragEl.parentNode; // actualization
|
41605
|
-
// must be done before animation
|
41606
41360
|
|
41361
|
+
// must be done before animation
|
41607
41362
|
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
41608
41363
|
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect$1(target)[side1]);
|
41609
41364
|
}
|
41610
|
-
|
41611
41365
|
changed();
|
41612
41366
|
return completed(true);
|
41613
41367
|
}
|
41614
41368
|
}
|
41615
|
-
|
41616
41369
|
if (el.contains(dragEl)) {
|
41617
41370
|
return completed(false);
|
41618
41371
|
}
|
41619
41372
|
}
|
41620
|
-
|
41621
41373
|
return false;
|
41622
41374
|
},
|
41623
41375
|
_ignoreWhileAnimating: null,
|
@@ -41637,83 +41389,69 @@ Sortable.prototype =
|
|
41637
41389
|
off(ownerDocument, 'touchcancel', this._onDrop);
|
41638
41390
|
off(document, 'selectstart', this);
|
41639
41391
|
},
|
41640
|
-
_onDrop: function _onDrop(
|
41641
|
-
/**Event*/
|
41642
|
-
evt) {
|
41392
|
+
_onDrop: function _onDrop( /**Event*/evt) {
|
41643
41393
|
var el = this.el,
|
41644
|
-
|
41394
|
+
options = this.options;
|
41645
41395
|
|
41396
|
+
// Get the index of the dragged element within its parent
|
41646
41397
|
newIndex = index(dragEl);
|
41647
41398
|
newDraggableIndex = index(dragEl, options.draggable);
|
41648
41399
|
pluginEvent('drop', this, {
|
41649
41400
|
evt: evt
|
41650
41401
|
});
|
41651
|
-
parentEl = dragEl && dragEl.parentNode;
|
41402
|
+
parentEl = dragEl && dragEl.parentNode;
|
41652
41403
|
|
41404
|
+
// Get again after plugin event
|
41653
41405
|
newIndex = index(dragEl);
|
41654
41406
|
newDraggableIndex = index(dragEl, options.draggable);
|
41655
|
-
|
41656
41407
|
if (Sortable.eventCanceled) {
|
41657
41408
|
this._nulling();
|
41658
|
-
|
41659
41409
|
return;
|
41660
41410
|
}
|
41661
|
-
|
41662
41411
|
awaitingDragStarted = false;
|
41663
41412
|
isCircumstantialInvert = false;
|
41664
41413
|
pastFirstInvertThresh = false;
|
41665
41414
|
clearInterval(this._loopId);
|
41666
41415
|
clearTimeout(this._dragStartTimer);
|
41667
|
-
|
41668
41416
|
_cancelNextTick(this.cloneId);
|
41417
|
+
_cancelNextTick(this._dragStartId);
|
41669
41418
|
|
41670
|
-
|
41671
|
-
|
41672
|
-
|
41419
|
+
// Unbind events
|
41673
41420
|
if (this.nativeDraggable) {
|
41674
41421
|
off(document, 'drop', this);
|
41675
41422
|
off(el, 'dragstart', this._onDragStart);
|
41676
41423
|
}
|
41677
|
-
|
41678
41424
|
this._offMoveEvents();
|
41679
|
-
|
41680
41425
|
this._offUpEvents();
|
41681
|
-
|
41682
41426
|
if (Safari) {
|
41683
41427
|
css$2(document.body, 'user-select', '');
|
41684
41428
|
}
|
41685
|
-
|
41686
41429
|
css$2(dragEl, 'transform', '');
|
41687
|
-
|
41688
41430
|
if (evt) {
|
41689
41431
|
if (moved) {
|
41690
41432
|
evt.cancelable && evt.preventDefault();
|
41691
41433
|
!options.dropBubble && evt.stopPropagation();
|
41692
41434
|
}
|
41693
|
-
|
41694
41435
|
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
41695
|
-
|
41696
41436
|
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
41697
41437
|
// Remove clone(s)
|
41698
41438
|
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
41699
41439
|
}
|
41700
|
-
|
41701
41440
|
if (dragEl) {
|
41702
41441
|
if (this.nativeDraggable) {
|
41703
41442
|
off(dragEl, 'dragend', this);
|
41704
41443
|
}
|
41705
|
-
|
41706
41444
|
_disableDraggable(dragEl);
|
41445
|
+
dragEl.style['will-change'] = '';
|
41707
41446
|
|
41708
|
-
|
41447
|
+
// Remove classes
|
41709
41448
|
// ghostClass is added in dragStarted
|
41710
|
-
|
41711
41449
|
if (moved && !awaitingDragStarted) {
|
41712
41450
|
toggleClass$1(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
41713
41451
|
}
|
41452
|
+
toggleClass$1(dragEl, this.options.chosenClass, false);
|
41714
41453
|
|
41715
|
-
|
41716
|
-
|
41454
|
+
// Drag stop event
|
41717
41455
|
_dispatchEvent({
|
41718
41456
|
sortable: this,
|
41719
41457
|
name: 'unchoose',
|
@@ -41722,7 +41460,6 @@ Sortable.prototype =
|
|
41722
41460
|
newDraggableIndex: null,
|
41723
41461
|
originalEvent: evt
|
41724
41462
|
});
|
41725
|
-
|
41726
41463
|
if (rootEl !== parentEl) {
|
41727
41464
|
if (newIndex >= 0) {
|
41728
41465
|
// Add event
|
@@ -41732,17 +41469,17 @@ Sortable.prototype =
|
|
41732
41469
|
toEl: parentEl,
|
41733
41470
|
fromEl: rootEl,
|
41734
41471
|
originalEvent: evt
|
41735
|
-
});
|
41736
|
-
|
41472
|
+
});
|
41737
41473
|
|
41474
|
+
// Remove event
|
41738
41475
|
_dispatchEvent({
|
41739
41476
|
sortable: this,
|
41740
41477
|
name: 'remove',
|
41741
41478
|
toEl: parentEl,
|
41742
41479
|
originalEvent: evt
|
41743
|
-
});
|
41744
|
-
|
41480
|
+
});
|
41745
41481
|
|
41482
|
+
// drag from one list and drop into another
|
41746
41483
|
_dispatchEvent({
|
41747
41484
|
rootEl: parentEl,
|
41748
41485
|
name: 'sort',
|
@@ -41750,7 +41487,6 @@ Sortable.prototype =
|
|
41750
41487
|
fromEl: rootEl,
|
41751
41488
|
originalEvent: evt
|
41752
41489
|
});
|
41753
|
-
|
41754
41490
|
_dispatchEvent({
|
41755
41491
|
sortable: this,
|
41756
41492
|
name: 'sort',
|
@@ -41758,7 +41494,6 @@ Sortable.prototype =
|
|
41758
41494
|
originalEvent: evt
|
41759
41495
|
});
|
41760
41496
|
}
|
41761
|
-
|
41762
41497
|
putSortable && putSortable.save();
|
41763
41498
|
} else {
|
41764
41499
|
if (newIndex !== oldIndex) {
|
@@ -41770,7 +41505,6 @@ Sortable.prototype =
|
|
41770
41505
|
toEl: parentEl,
|
41771
41506
|
originalEvent: evt
|
41772
41507
|
});
|
41773
|
-
|
41774
41508
|
_dispatchEvent({
|
41775
41509
|
sortable: this,
|
41776
41510
|
name: 'sort',
|
@@ -41780,27 +41514,24 @@ Sortable.prototype =
|
|
41780
41514
|
}
|
41781
41515
|
}
|
41782
41516
|
}
|
41783
|
-
|
41784
41517
|
if (Sortable.active) {
|
41785
41518
|
/* jshint eqnull:true */
|
41786
41519
|
if (newIndex == null || newIndex === -1) {
|
41787
41520
|
newIndex = oldIndex;
|
41788
41521
|
newDraggableIndex = oldDraggableIndex;
|
41789
41522
|
}
|
41790
|
-
|
41791
41523
|
_dispatchEvent({
|
41792
41524
|
sortable: this,
|
41793
41525
|
name: 'end',
|
41794
41526
|
toEl: parentEl,
|
41795
41527
|
originalEvent: evt
|
41796
|
-
});
|
41797
|
-
|
41528
|
+
});
|
41798
41529
|
|
41530
|
+
// Save sorting
|
41799
41531
|
this.save();
|
41800
41532
|
}
|
41801
41533
|
}
|
41802
41534
|
}
|
41803
|
-
|
41804
41535
|
this._nulling();
|
41805
41536
|
},
|
41806
41537
|
_nulling: function _nulling() {
|
@@ -41811,65 +41542,52 @@ Sortable.prototype =
|
|
41811
41542
|
});
|
41812
41543
|
savedInputChecked.length = lastDx = lastDy = 0;
|
41813
41544
|
},
|
41814
|
-
handleEvent: function handleEvent(
|
41815
|
-
/**Event*/
|
41816
|
-
evt) {
|
41545
|
+
handleEvent: function handleEvent( /**Event*/evt) {
|
41817
41546
|
switch (evt.type) {
|
41818
41547
|
case 'drop':
|
41819
41548
|
case 'dragend':
|
41820
41549
|
this._onDrop(evt);
|
41821
|
-
|
41822
41550
|
break;
|
41823
|
-
|
41824
41551
|
case 'dragenter':
|
41825
41552
|
case 'dragover':
|
41826
41553
|
if (dragEl) {
|
41827
41554
|
this._onDragOver(evt);
|
41828
|
-
|
41829
41555
|
_globalDragOver(evt);
|
41830
41556
|
}
|
41831
|
-
|
41832
41557
|
break;
|
41833
|
-
|
41834
41558
|
case 'selectstart':
|
41835
41559
|
evt.preventDefault();
|
41836
41560
|
break;
|
41837
41561
|
}
|
41838
41562
|
},
|
41839
|
-
|
41840
|
-
|
41841
|
-
*
|
41842
|
-
* @returns {String[]}
|
41563
|
+
/**
|
41564
|
+
* Serializes the item into an array of string.
|
41565
|
+
* @returns {String[]}
|
41843
41566
|
*/
|
41844
41567
|
toArray: function toArray() {
|
41845
41568
|
var order = [],
|
41846
|
-
|
41847
|
-
|
41848
|
-
|
41849
|
-
|
41850
|
-
|
41851
|
-
|
41569
|
+
el,
|
41570
|
+
children = this.el.children,
|
41571
|
+
i = 0,
|
41572
|
+
n = children.length,
|
41573
|
+
options = this.options;
|
41852
41574
|
for (; i < n; i++) {
|
41853
41575
|
el = children[i];
|
41854
|
-
|
41855
41576
|
if (closest(el, options.draggable, this.el, false)) {
|
41856
41577
|
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
41857
41578
|
}
|
41858
41579
|
}
|
41859
|
-
|
41860
41580
|
return order;
|
41861
41581
|
},
|
41862
|
-
|
41863
|
-
|
41864
|
-
*
|
41865
|
-
* @param {String[]} order order of the items
|
41582
|
+
/**
|
41583
|
+
* Sorts the elements according to the array.
|
41584
|
+
* @param {String[]} order order of the items
|
41866
41585
|
*/
|
41867
41586
|
sort: function sort(order, useAnimation) {
|
41868
41587
|
var items = {},
|
41869
|
-
|
41588
|
+
rootEl = this.el;
|
41870
41589
|
this.toArray().forEach(function (id, i) {
|
41871
41590
|
var el = rootEl.children[i];
|
41872
|
-
|
41873
41591
|
if (closest(el, this.options.draggable, rootEl, false)) {
|
41874
41592
|
items[id] = el;
|
41875
41593
|
}
|
@@ -41883,53 +41601,46 @@ Sortable.prototype =
|
|
41883
41601
|
});
|
41884
41602
|
useAnimation && this.animateAll();
|
41885
41603
|
},
|
41886
|
-
|
41887
|
-
|
41888
|
-
* Save the current sorting
|
41604
|
+
/**
|
41605
|
+
* Save the current sorting
|
41889
41606
|
*/
|
41890
41607
|
save: function save() {
|
41891
41608
|
var store = this.options.store;
|
41892
41609
|
store && store.set && store.set(this);
|
41893
41610
|
},
|
41894
|
-
|
41895
|
-
|
41896
|
-
*
|
41897
|
-
* @param {
|
41898
|
-
* @
|
41899
|
-
* @returns {HTMLElement|null}
|
41611
|
+
/**
|
41612
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
41613
|
+
* @param {HTMLElement} el
|
41614
|
+
* @param {String} [selector] default: `options.draggable`
|
41615
|
+
* @returns {HTMLElement|null}
|
41900
41616
|
*/
|
41901
41617
|
closest: function closest$1(el, selector) {
|
41902
41618
|
return closest(el, selector || this.options.draggable, this.el, false);
|
41903
41619
|
},
|
41904
|
-
|
41905
|
-
|
41906
|
-
*
|
41907
|
-
* @param {
|
41908
|
-
* @
|
41909
|
-
* @returns {*}
|
41620
|
+
/**
|
41621
|
+
* Set/get option
|
41622
|
+
* @param {string} name
|
41623
|
+
* @param {*} [value]
|
41624
|
+
* @returns {*}
|
41910
41625
|
*/
|
41911
41626
|
option: function option(name, value) {
|
41912
41627
|
var options = this.options;
|
41913
|
-
|
41914
41628
|
if (value === void 0) {
|
41915
41629
|
return options[name];
|
41916
41630
|
} else {
|
41917
41631
|
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
41918
|
-
|
41919
41632
|
if (typeof modifiedValue !== 'undefined') {
|
41920
41633
|
options[name] = modifiedValue;
|
41921
41634
|
} else {
|
41922
41635
|
options[name] = value;
|
41923
41636
|
}
|
41924
|
-
|
41925
41637
|
if (name === 'group') {
|
41926
41638
|
_prepareGroup(options);
|
41927
41639
|
}
|
41928
41640
|
}
|
41929
41641
|
},
|
41930
|
-
|
41931
|
-
|
41932
|
-
* Destroy
|
41642
|
+
/**
|
41643
|
+
* Destroy
|
41933
41644
|
*/
|
41934
41645
|
destroy: function destroy() {
|
41935
41646
|
pluginEvent('destroy', this);
|
@@ -41938,21 +41649,16 @@ Sortable.prototype =
|
|
41938
41649
|
off(el, 'mousedown', this._onTapStart);
|
41939
41650
|
off(el, 'touchstart', this._onTapStart);
|
41940
41651
|
off(el, 'pointerdown', this._onTapStart);
|
41941
|
-
|
41942
41652
|
if (this.nativeDraggable) {
|
41943
41653
|
off(el, 'dragover', this);
|
41944
41654
|
off(el, 'dragenter', this);
|
41945
|
-
}
|
41946
|
-
|
41947
|
-
|
41655
|
+
}
|
41656
|
+
// Remove draggable attributes
|
41948
41657
|
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
41949
41658
|
el.removeAttribute('draggable');
|
41950
41659
|
});
|
41951
|
-
|
41952
41660
|
this._onDrop();
|
41953
|
-
|
41954
41661
|
this._disableDelayedDragEvents();
|
41955
|
-
|
41956
41662
|
sortables.splice(sortables.indexOf(this.el), 1);
|
41957
41663
|
this.el = el = null;
|
41958
41664
|
},
|
@@ -41961,25 +41667,22 @@ Sortable.prototype =
|
|
41961
41667
|
pluginEvent('hideClone', this);
|
41962
41668
|
if (Sortable.eventCanceled) return;
|
41963
41669
|
css$2(cloneEl, 'display', 'none');
|
41964
|
-
|
41965
41670
|
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
41966
41671
|
cloneEl.parentNode.removeChild(cloneEl);
|
41967
41672
|
}
|
41968
|
-
|
41969
41673
|
cloneHidden = true;
|
41970
41674
|
}
|
41971
41675
|
},
|
41972
41676
|
_showClone: function _showClone(putSortable) {
|
41973
41677
|
if (putSortable.lastPutMode !== 'clone') {
|
41974
41678
|
this._hideClone();
|
41975
|
-
|
41976
41679
|
return;
|
41977
41680
|
}
|
41978
|
-
|
41979
41681
|
if (cloneHidden) {
|
41980
41682
|
pluginEvent('showClone', this);
|
41981
|
-
if (Sortable.eventCanceled) return;
|
41683
|
+
if (Sortable.eventCanceled) return;
|
41982
41684
|
|
41685
|
+
// show clone at dragEl or original position
|
41983
41686
|
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
41984
41687
|
rootEl.insertBefore(cloneEl, dragEl);
|
41985
41688
|
} else if (nextEl) {
|
@@ -41987,33 +41690,26 @@ Sortable.prototype =
|
|
41987
41690
|
} else {
|
41988
41691
|
rootEl.appendChild(cloneEl);
|
41989
41692
|
}
|
41990
|
-
|
41991
41693
|
if (this.options.group.revertClone) {
|
41992
41694
|
this.animate(dragEl, cloneEl);
|
41993
41695
|
}
|
41994
|
-
|
41995
41696
|
css$2(cloneEl, 'display', '');
|
41996
41697
|
cloneHidden = false;
|
41997
41698
|
}
|
41998
41699
|
}
|
41999
41700
|
};
|
42000
|
-
|
42001
|
-
function _globalDragOver(
|
42002
|
-
/**Event*/
|
42003
|
-
evt) {
|
41701
|
+
function _globalDragOver( /**Event*/evt) {
|
42004
41702
|
if (evt.dataTransfer) {
|
42005
41703
|
evt.dataTransfer.dropEffect = 'move';
|
42006
41704
|
}
|
42007
|
-
|
42008
41705
|
evt.cancelable && evt.preventDefault();
|
42009
41706
|
}
|
42010
|
-
|
42011
41707
|
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
42012
41708
|
var evt,
|
42013
|
-
|
42014
|
-
|
42015
|
-
|
42016
|
-
|
41709
|
+
sortable = fromEl[expando],
|
41710
|
+
onMoveFn = sortable.options.onMove,
|
41711
|
+
retVal;
|
41712
|
+
// Support for new CustomEvent feature
|
42017
41713
|
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
42018
41714
|
evt = new CustomEvent('move', {
|
42019
41715
|
bubbles: true,
|
@@ -42023,7 +41719,6 @@ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalE
|
|
42023
41719
|
evt = document.createEvent('Event');
|
42024
41720
|
evt.initEvent('move', true, true);
|
42025
41721
|
}
|
42026
|
-
|
42027
41722
|
evt.to = toEl;
|
42028
41723
|
evt.from = fromEl;
|
42029
41724
|
evt.dragged = dragEl;
|
@@ -42033,41 +41728,35 @@ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalE
|
|
42033
41728
|
evt.willInsertAfter = willInsertAfter;
|
42034
41729
|
evt.originalEvent = originalEvent;
|
42035
41730
|
fromEl.dispatchEvent(evt);
|
42036
|
-
|
42037
41731
|
if (onMoveFn) {
|
42038
41732
|
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
42039
41733
|
}
|
42040
|
-
|
42041
41734
|
return retVal;
|
42042
41735
|
}
|
42043
|
-
|
42044
41736
|
function _disableDraggable(el) {
|
42045
41737
|
el.draggable = false;
|
42046
41738
|
}
|
42047
|
-
|
42048
41739
|
function _unsilent() {
|
42049
41740
|
_silent = false;
|
42050
41741
|
}
|
42051
|
-
|
42052
41742
|
function _ghostIsFirst(evt, vertical, sortable) {
|
42053
|
-
var
|
41743
|
+
var firstElRect = getRect$1(getChild(sortable.el, 0, sortable.options, true));
|
41744
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
42054
41745
|
var spacer = 10;
|
42055
|
-
return vertical ? evt.clientX <
|
41746
|
+
return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
|
42056
41747
|
}
|
42057
|
-
|
42058
41748
|
function _ghostIsLast(evt, vertical, sortable) {
|
42059
|
-
var
|
41749
|
+
var lastElRect = getRect$1(lastChild(sortable.el, sortable.options.draggable));
|
41750
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
42060
41751
|
var spacer = 10;
|
42061
|
-
return vertical ? evt.clientX >
|
41752
|
+
return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
|
42062
41753
|
}
|
42063
|
-
|
42064
41754
|
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
42065
41755
|
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
42066
|
-
|
42067
|
-
|
42068
|
-
|
42069
|
-
|
42070
|
-
|
41756
|
+
targetLength = vertical ? targetRect.height : targetRect.width,
|
41757
|
+
targetS1 = vertical ? targetRect.top : targetRect.left,
|
41758
|
+
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
41759
|
+
invert = false;
|
42071
41760
|
if (!invertSwap) {
|
42072
41761
|
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
42073
41762
|
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
@@ -42077,7 +41766,6 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv
|
|
42077
41766
|
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
42078
41767
|
pastFirstInvertThresh = true;
|
42079
41768
|
}
|
42080
|
-
|
42081
41769
|
if (!pastFirstInvertThresh) {
|
42082
41770
|
// dragEl shadow (target move distance shadow)
|
42083
41771
|
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
@@ -42094,26 +41782,22 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv
|
|
42094
41782
|
}
|
42095
41783
|
}
|
42096
41784
|
}
|
42097
|
-
|
42098
41785
|
invert = invert || invertSwap;
|
42099
|
-
|
42100
41786
|
if (invert) {
|
42101
41787
|
// Invert of regular
|
42102
41788
|
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
42103
41789
|
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
42104
41790
|
}
|
42105
41791
|
}
|
42106
|
-
|
42107
41792
|
return 0;
|
42108
41793
|
}
|
42109
|
-
/**
|
42110
|
-
* Gets the direction dragEl must be swapped relative to target in order to make it
|
42111
|
-
* seem that dragEl has been "inserted" into that element's position
|
42112
|
-
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
42113
|
-
* @return {Number} Direction dragEl must be swapped
|
42114
|
-
*/
|
42115
|
-
|
42116
41794
|
|
41795
|
+
/**
|
41796
|
+
* Gets the direction dragEl must be swapped relative to target in order to make it
|
41797
|
+
* seem that dragEl has been "inserted" into that element's position
|
41798
|
+
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
41799
|
+
* @return {Number} Direction dragEl must be swapped
|
41800
|
+
*/
|
42117
41801
|
function _getInsertDirection(target) {
|
42118
41802
|
if (index(dragEl) < index(target)) {
|
42119
41803
|
return 1;
|
@@ -42121,55 +41805,48 @@ function _getInsertDirection(target) {
|
|
42121
41805
|
return -1;
|
42122
41806
|
}
|
42123
41807
|
}
|
42124
|
-
/**
|
42125
|
-
* Generate id
|
42126
|
-
* @param {HTMLElement} el
|
42127
|
-
* @returns {String}
|
42128
|
-
* @private
|
42129
|
-
*/
|
42130
|
-
|
42131
41808
|
|
41809
|
+
/**
|
41810
|
+
* Generate id
|
41811
|
+
* @param {HTMLElement} el
|
41812
|
+
* @returns {String}
|
41813
|
+
* @private
|
41814
|
+
*/
|
42132
41815
|
function _generateId(el) {
|
42133
41816
|
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
42134
|
-
|
42135
|
-
|
42136
|
-
|
41817
|
+
i = str.length,
|
41818
|
+
sum = 0;
|
42137
41819
|
while (i--) {
|
42138
41820
|
sum += str.charCodeAt(i);
|
42139
41821
|
}
|
42140
|
-
|
42141
41822
|
return sum.toString(36);
|
42142
41823
|
}
|
42143
|
-
|
42144
41824
|
function _saveInputCheckedState(root) {
|
42145
41825
|
savedInputChecked.length = 0;
|
42146
41826
|
var inputs = root.getElementsByTagName('input');
|
42147
41827
|
var idx = inputs.length;
|
42148
|
-
|
42149
41828
|
while (idx--) {
|
42150
41829
|
var el = inputs[idx];
|
42151
41830
|
el.checked && savedInputChecked.push(el);
|
42152
41831
|
}
|
42153
41832
|
}
|
42154
|
-
|
42155
41833
|
function _nextTick(fn) {
|
42156
41834
|
return setTimeout(fn, 0);
|
42157
41835
|
}
|
42158
|
-
|
42159
41836
|
function _cancelNextTick(id) {
|
42160
41837
|
return clearTimeout(id);
|
42161
|
-
}
|
42162
|
-
|
41838
|
+
}
|
42163
41839
|
|
41840
|
+
// Fixed #973:
|
42164
41841
|
if (documentExists) {
|
42165
41842
|
on(document, 'touchmove', function (evt) {
|
42166
41843
|
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
42167
41844
|
evt.preventDefault();
|
42168
41845
|
}
|
42169
41846
|
});
|
42170
|
-
}
|
42171
|
-
|
41847
|
+
}
|
42172
41848
|
|
41849
|
+
// Export utils
|
42173
41850
|
Sortable.utils = {
|
42174
41851
|
on: on,
|
42175
41852
|
off: off,
|
@@ -42189,59 +41866,54 @@ Sortable.utils = {
|
|
42189
41866
|
detectDirection: _detectDirection,
|
42190
41867
|
getChild: getChild
|
42191
41868
|
};
|
42192
|
-
/**
|
42193
|
-
* Get the Sortable instance of an element
|
42194
|
-
* @param {HTMLElement} element The element
|
42195
|
-
* @return {Sortable|undefined} The instance of Sortable
|
42196
|
-
*/
|
42197
41869
|
|
41870
|
+
/**
|
41871
|
+
* Get the Sortable instance of an element
|
41872
|
+
* @param {HTMLElement} element The element
|
41873
|
+
* @return {Sortable|undefined} The instance of Sortable
|
41874
|
+
*/
|
42198
41875
|
Sortable.get = function (element) {
|
42199
41876
|
return element[expando];
|
42200
41877
|
};
|
42201
|
-
/**
|
42202
|
-
* Mount a plugin to Sortable
|
42203
|
-
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
42204
|
-
*/
|
42205
|
-
|
42206
41878
|
|
41879
|
+
/**
|
41880
|
+
* Mount a plugin to Sortable
|
41881
|
+
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
41882
|
+
*/
|
42207
41883
|
Sortable.mount = function () {
|
42208
41884
|
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
42209
41885
|
plugins[_key] = arguments[_key];
|
42210
41886
|
}
|
42211
|
-
|
42212
41887
|
if (plugins[0].constructor === Array) plugins = plugins[0];
|
42213
41888
|
plugins.forEach(function (plugin) {
|
42214
41889
|
if (!plugin.prototype || !plugin.prototype.constructor) {
|
42215
41890
|
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
42216
41891
|
}
|
42217
|
-
|
42218
41892
|
if (plugin.utils) Sortable.utils = _objectSpread2$1(_objectSpread2$1({}, Sortable.utils), plugin.utils);
|
42219
41893
|
PluginManager.mount(plugin);
|
42220
41894
|
});
|
42221
41895
|
};
|
42222
|
-
/**
|
42223
|
-
* Create sortable instance
|
42224
|
-
* @param {HTMLElement} el
|
42225
|
-
* @param {Object} [options]
|
42226
|
-
*/
|
42227
|
-
|
42228
41896
|
|
41897
|
+
/**
|
41898
|
+
* Create sortable instance
|
41899
|
+
* @param {HTMLElement} el
|
41900
|
+
* @param {Object} [options]
|
41901
|
+
*/
|
42229
41902
|
Sortable.create = function (el, options) {
|
42230
41903
|
return new Sortable(el, options);
|
42231
|
-
};
|
42232
|
-
|
41904
|
+
};
|
42233
41905
|
|
41906
|
+
// Export
|
42234
41907
|
Sortable.version = version$1;
|
42235
41908
|
|
42236
41909
|
var autoScrolls = [],
|
42237
|
-
|
42238
|
-
|
42239
|
-
|
42240
|
-
|
42241
|
-
|
42242
|
-
|
42243
|
-
|
42244
|
-
|
41910
|
+
scrollEl,
|
41911
|
+
scrollRootEl,
|
41912
|
+
scrolling = false,
|
41913
|
+
lastAutoScrollX,
|
41914
|
+
lastAutoScrollY,
|
41915
|
+
touchEvt$1,
|
41916
|
+
pointerElemChangedInterval;
|
42245
41917
|
function AutoScrollPlugin() {
|
42246
41918
|
function AutoScroll() {
|
42247
41919
|
this.defaults = {
|
@@ -42250,19 +41922,18 @@ function AutoScrollPlugin() {
|
|
42250
41922
|
scrollSensitivity: 30,
|
42251
41923
|
scrollSpeed: 10,
|
42252
41924
|
bubbleScroll: true
|
42253
|
-
};
|
41925
|
+
};
|
42254
41926
|
|
41927
|
+
// Bind all private methods
|
42255
41928
|
for (var fn in this) {
|
42256
41929
|
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
42257
41930
|
this[fn] = this[fn].bind(this);
|
42258
41931
|
}
|
42259
41932
|
}
|
42260
41933
|
}
|
42261
|
-
|
42262
41934
|
AutoScroll.prototype = {
|
42263
41935
|
dragStarted: function dragStarted(_ref) {
|
42264
41936
|
var originalEvent = _ref.originalEvent;
|
42265
|
-
|
42266
41937
|
if (this.sortable.nativeDraggable) {
|
42267
41938
|
on(document, 'dragover', this._handleAutoScroll);
|
42268
41939
|
} else {
|
@@ -42277,7 +41948,6 @@ function AutoScrollPlugin() {
|
|
42277
41948
|
},
|
42278
41949
|
dragOverCompleted: function dragOverCompleted(_ref2) {
|
42279
41950
|
var originalEvent = _ref2.originalEvent;
|
42280
|
-
|
42281
41951
|
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
42282
41952
|
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
42283
41953
|
this._handleAutoScroll(originalEvent);
|
@@ -42291,7 +41961,6 @@ function AutoScrollPlugin() {
|
|
42291
41961
|
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
42292
41962
|
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
42293
41963
|
}
|
42294
|
-
|
42295
41964
|
clearPointerElemChangedInterval();
|
42296
41965
|
clearAutoScrolls();
|
42297
41966
|
cancelThrottle();
|
@@ -42305,31 +41974,29 @@ function AutoScrollPlugin() {
|
|
42305
41974
|
},
|
42306
41975
|
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
42307
41976
|
var _this = this;
|
42308
|
-
|
42309
41977
|
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
42310
|
-
|
42311
|
-
|
42312
|
-
touchEvt$1 = evt;
|
41978
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
41979
|
+
elem = document.elementFromPoint(x, y);
|
41980
|
+
touchEvt$1 = evt;
|
41981
|
+
|
41982
|
+
// IE does not seem to have native autoscroll,
|
42313
41983
|
// Edge's autoscroll seems too conditional,
|
42314
41984
|
// MACOS Safari does not have autoscroll,
|
42315
41985
|
// Firefox and Chrome are good
|
42316
|
-
|
42317
41986
|
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
42318
|
-
autoScroll(evt, this.options, elem, fallback);
|
41987
|
+
autoScroll(evt, this.options, elem, fallback);
|
42319
41988
|
|
41989
|
+
// Listener for pointer element change
|
42320
41990
|
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
42321
|
-
|
42322
41991
|
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
42323
|
-
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
42324
|
-
|
41992
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
41993
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
42325
41994
|
pointerElemChangedInterval = setInterval(function () {
|
42326
41995
|
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
42327
|
-
|
42328
41996
|
if (newElem !== ogElemScroller) {
|
42329
41997
|
ogElemScroller = newElem;
|
42330
41998
|
clearAutoScrolls();
|
42331
41999
|
}
|
42332
|
-
|
42333
42000
|
autoScroll(evt, _this.options, newElem, fallback);
|
42334
42001
|
}, 10);
|
42335
42002
|
lastAutoScrollX = x;
|
@@ -42341,7 +42008,6 @@ function AutoScrollPlugin() {
|
|
42341
42008
|
clearAutoScrolls();
|
42342
42009
|
return;
|
42343
42010
|
}
|
42344
|
-
|
42345
42011
|
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
42346
42012
|
}
|
42347
42013
|
}
|
@@ -42351,60 +42017,54 @@ function AutoScrollPlugin() {
|
|
42351
42017
|
initializeByDefault: true
|
42352
42018
|
});
|
42353
42019
|
}
|
42354
|
-
|
42355
42020
|
function clearAutoScrolls() {
|
42356
42021
|
autoScrolls.forEach(function (autoScroll) {
|
42357
42022
|
clearInterval(autoScroll.pid);
|
42358
42023
|
});
|
42359
42024
|
autoScrolls = [];
|
42360
42025
|
}
|
42361
|
-
|
42362
42026
|
function clearPointerElemChangedInterval() {
|
42363
42027
|
clearInterval(pointerElemChangedInterval);
|
42364
42028
|
}
|
42365
|
-
|
42366
42029
|
var autoScroll = throttle$1(function (evt, options, rootEl, isFallback) {
|
42367
42030
|
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
42368
42031
|
if (!options.scroll) return;
|
42369
42032
|
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
42370
|
-
|
42371
|
-
|
42372
|
-
|
42373
|
-
|
42033
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
42034
|
+
sens = options.scrollSensitivity,
|
42035
|
+
speed = options.scrollSpeed,
|
42036
|
+
winScroller = getWindowScrollingElement();
|
42374
42037
|
var scrollThisInstance = false,
|
42375
|
-
|
42038
|
+
scrollCustomFn;
|
42376
42039
|
|
42040
|
+
// New scroll root, set scrollEl
|
42377
42041
|
if (scrollRootEl !== rootEl) {
|
42378
42042
|
scrollRootEl = rootEl;
|
42379
42043
|
clearAutoScrolls();
|
42380
42044
|
scrollEl = options.scroll;
|
42381
42045
|
scrollCustomFn = options.scrollFn;
|
42382
|
-
|
42383
42046
|
if (scrollEl === true) {
|
42384
42047
|
scrollEl = getParentAutoScrollElement(rootEl, true);
|
42385
42048
|
}
|
42386
42049
|
}
|
42387
|
-
|
42388
42050
|
var layersOut = 0;
|
42389
42051
|
var currentParent = scrollEl;
|
42390
|
-
|
42391
42052
|
do {
|
42392
42053
|
var el = currentParent,
|
42393
|
-
|
42394
|
-
|
42395
|
-
|
42396
|
-
|
42397
|
-
|
42398
|
-
|
42399
|
-
|
42400
|
-
|
42401
|
-
|
42402
|
-
|
42403
|
-
|
42404
|
-
|
42405
|
-
|
42406
|
-
|
42407
|
-
|
42054
|
+
rect = getRect$1(el),
|
42055
|
+
top = rect.top,
|
42056
|
+
bottom = rect.bottom,
|
42057
|
+
left = rect.left,
|
42058
|
+
right = rect.right,
|
42059
|
+
width = rect.width,
|
42060
|
+
height = rect.height,
|
42061
|
+
canScrollX = void 0,
|
42062
|
+
canScrollY = void 0,
|
42063
|
+
scrollWidth = el.scrollWidth,
|
42064
|
+
scrollHeight = el.scrollHeight,
|
42065
|
+
elCSS = css$2(el),
|
42066
|
+
scrollPosX = el.scrollLeft,
|
42067
|
+
scrollPosY = el.scrollTop;
|
42408
42068
|
if (el === winScroller) {
|
42409
42069
|
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
42410
42070
|
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
@@ -42412,10 +42072,8 @@ var autoScroll = throttle$1(function (evt, options, rootEl, isFallback) {
|
|
42412
42072
|
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
42413
42073
|
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
42414
42074
|
}
|
42415
|
-
|
42416
42075
|
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
42417
42076
|
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
42418
|
-
|
42419
42077
|
if (!autoScrolls[layersOut]) {
|
42420
42078
|
for (var i = 0; i <= layersOut; i++) {
|
42421
42079
|
if (!autoScrolls[i]) {
|
@@ -42423,61 +42081,51 @@ var autoScroll = throttle$1(function (evt, options, rootEl, isFallback) {
|
|
42423
42081
|
}
|
42424
42082
|
}
|
42425
42083
|
}
|
42426
|
-
|
42427
42084
|
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
42428
42085
|
autoScrolls[layersOut].el = el;
|
42429
42086
|
autoScrolls[layersOut].vx = vx;
|
42430
42087
|
autoScrolls[layersOut].vy = vy;
|
42431
42088
|
clearInterval(autoScrolls[layersOut].pid);
|
42432
|
-
|
42433
42089
|
if (vx != 0 || vy != 0) {
|
42434
42090
|
scrollThisInstance = true;
|
42435
42091
|
/* jshint loopfunc:true */
|
42436
|
-
|
42437
42092
|
autoScrolls[layersOut].pid = setInterval(function () {
|
42438
42093
|
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
42439
42094
|
if (isFallback && this.layer === 0) {
|
42440
42095
|
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
42441
|
-
|
42442
42096
|
}
|
42443
|
-
|
42444
42097
|
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
42445
42098
|
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
42446
|
-
|
42447
42099
|
if (typeof scrollCustomFn === 'function') {
|
42448
42100
|
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
42449
42101
|
return;
|
42450
42102
|
}
|
42451
42103
|
}
|
42452
|
-
|
42453
42104
|
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
42454
42105
|
}.bind({
|
42455
42106
|
layer: layersOut
|
42456
42107
|
}), 24);
|
42457
42108
|
}
|
42458
42109
|
}
|
42459
|
-
|
42460
42110
|
layersOut++;
|
42461
42111
|
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
42462
|
-
|
42463
42112
|
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
42464
42113
|
}, 30);
|
42465
42114
|
|
42466
42115
|
var drop = function drop(_ref) {
|
42467
42116
|
var originalEvent = _ref.originalEvent,
|
42468
|
-
|
42469
|
-
|
42470
|
-
|
42471
|
-
|
42472
|
-
|
42473
|
-
|
42117
|
+
putSortable = _ref.putSortable,
|
42118
|
+
dragEl = _ref.dragEl,
|
42119
|
+
activeSortable = _ref.activeSortable,
|
42120
|
+
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
42121
|
+
hideGhostForTarget = _ref.hideGhostForTarget,
|
42122
|
+
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
42474
42123
|
if (!originalEvent) return;
|
42475
42124
|
var toSortable = putSortable || activeSortable;
|
42476
42125
|
hideGhostForTarget();
|
42477
42126
|
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
42478
42127
|
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
42479
42128
|
unhideGhostForTarget();
|
42480
|
-
|
42481
42129
|
if (toSortable && !toSortable.el.contains(target)) {
|
42482
42130
|
dispatchSortableEvent('spill');
|
42483
42131
|
this.onSpill({
|
@@ -42486,9 +42134,7 @@ var drop = function drop(_ref) {
|
|
42486
42134
|
});
|
42487
42135
|
}
|
42488
42136
|
};
|
42489
|
-
|
42490
42137
|
function Revert() {}
|
42491
|
-
|
42492
42138
|
Revert.prototype = {
|
42493
42139
|
startIndex: null,
|
42494
42140
|
dragStart: function dragStart(_ref2) {
|
@@ -42497,40 +42143,32 @@ Revert.prototype = {
|
|
42497
42143
|
},
|
42498
42144
|
onSpill: function onSpill(_ref3) {
|
42499
42145
|
var dragEl = _ref3.dragEl,
|
42500
|
-
|
42146
|
+
putSortable = _ref3.putSortable;
|
42501
42147
|
this.sortable.captureAnimationState();
|
42502
|
-
|
42503
42148
|
if (putSortable) {
|
42504
42149
|
putSortable.captureAnimationState();
|
42505
42150
|
}
|
42506
|
-
|
42507
42151
|
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
42508
|
-
|
42509
42152
|
if (nextSibling) {
|
42510
42153
|
this.sortable.el.insertBefore(dragEl, nextSibling);
|
42511
42154
|
} else {
|
42512
42155
|
this.sortable.el.appendChild(dragEl);
|
42513
42156
|
}
|
42514
|
-
|
42515
42157
|
this.sortable.animateAll();
|
42516
|
-
|
42517
42158
|
if (putSortable) {
|
42518
42159
|
putSortable.animateAll();
|
42519
42160
|
}
|
42520
42161
|
},
|
42521
42162
|
drop: drop
|
42522
42163
|
};
|
42523
|
-
|
42524
42164
|
_extends(Revert, {
|
42525
42165
|
pluginName: 'revertOnSpill'
|
42526
42166
|
});
|
42527
|
-
|
42528
42167
|
function Remove() {}
|
42529
|
-
|
42530
42168
|
Remove.prototype = {
|
42531
42169
|
onSpill: function onSpill(_ref4) {
|
42532
42170
|
var dragEl = _ref4.dragEl,
|
42533
|
-
|
42171
|
+
putSortable = _ref4.putSortable;
|
42534
42172
|
var parentSortable = putSortable || this.sortable;
|
42535
42173
|
parentSortable.captureAnimationState();
|
42536
42174
|
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
@@ -42538,7 +42176,6 @@ Remove.prototype = {
|
|
42538
42176
|
},
|
42539
42177
|
drop: drop
|
42540
42178
|
};
|
42541
|
-
|
42542
42179
|
_extends(Remove, {
|
42543
42180
|
pluginName: 'removeOnSpill'
|
42544
42181
|
});
|
@@ -43148,6 +42785,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
43148
42785
|
obj.destroy();
|
43149
42786
|
}
|
43150
42787
|
});
|
42788
|
+
builder.sortableOnCanvas = [];
|
43151
42789
|
}
|
43152
42790
|
if (builder.sortableOnPage) builder.sortableOnPage.destroy();
|
43153
42791
|
let dummies = builder.doc.querySelectorAll('.block-dummy');
|
@@ -108682,6 +108320,8 @@ class Resizable {
|
|
108682
108320
|
this.doc.addEventListener('mouseup', this.handleResizeEnd);
|
108683
108321
|
this.doc.addEventListener('touchmove', this.handleResizeMove);
|
108684
108322
|
this.doc.addEventListener('touchend', this.handleResizeEnd);
|
108323
|
+
document.addEventListener('mouseup', this.handleResizeEnd); // in iframe, mouseup can be triggered outside the iframe (during resizing)
|
108324
|
+
document.addEventListener('touchend', this.handleResizeEnd);
|
108685
108325
|
}
|
108686
108326
|
handleResizeMove(event) {
|
108687
108327
|
if (this.isResizing) {
|
@@ -108732,6 +108372,8 @@ class Resizable {
|
|
108732
108372
|
this.doc.removeEventListener('mouseup', this.handleResizeEnd);
|
108733
108373
|
this.doc.removeEventListener('touchmove', this.handleResizeMove);
|
108734
108374
|
this.doc.removeEventListener('touchend', this.handleResizeEnd);
|
108375
|
+
document.removeEventListener('mouseup', this.handleResizeEnd); // in iframe, mouseup can be triggered outside the iframe (during resizing)
|
108376
|
+
document.removeEventListener('touchend', this.handleResizeEnd);
|
108735
108377
|
this.ruler.hideRulers();
|
108736
108378
|
}
|
108737
108379
|
resizeTopLeft(deltaX, deltaY) {
|
@@ -113556,6 +113198,59 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
113556
113198
|
}
|
113557
113199
|
});
|
113558
113200
|
|
113201
|
+
// Canvas Mode
|
113202
|
+
const copyBlock = e => {
|
113203
|
+
const docContainer = this.doc.querySelector(this.docContainer);
|
113204
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 67) {
|
113205
|
+
//CTRL-C
|
113206
|
+
const activeBlock = docContainer.querySelector('.is-block.active'); // always get .cloned
|
113207
|
+
if (activeBlock) {
|
113208
|
+
this.copyBlock = activeBlock;
|
113209
|
+
}
|
113210
|
+
}
|
113211
|
+
};
|
113212
|
+
const pasteBlock = e => {
|
113213
|
+
const docContainer = this.doc.querySelector(this.docContainer);
|
113214
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 86) {
|
113215
|
+
//CTRL-V
|
113216
|
+
|
113217
|
+
const box = docContainer.querySelector('.is-box.box-select'); // always get .cloned
|
113218
|
+
let block = this.copyBlock;
|
113219
|
+
if (box && block) {
|
113220
|
+
if (document.querySelector('.is-modal.active:not(.is-modal-content)')) return;
|
113221
|
+
const focusedElement = e.target;
|
113222
|
+
const isEditable = focusedElement.tagName === 'INPUT' || focusedElement.tagName === 'TEXTAREA' || focusedElement.hasAttribute('contenteditable');
|
113223
|
+
if (isEditable) return;
|
113224
|
+
this.uo.saveForUndo();
|
113225
|
+
let block = this.copyBlock;
|
113226
|
+
const builder = block.querySelector(this.container);
|
113227
|
+
let html = '';
|
113228
|
+
if (builder) {
|
113229
|
+
html = this.readHtml(builder);
|
113230
|
+
}
|
113231
|
+
let clonedDiv = block.cloneNode(true);
|
113232
|
+
clonedDiv.style.top = '20%';
|
113233
|
+
clonedDiv.style.left = '20%';
|
113234
|
+
if (builder) {
|
113235
|
+
const cloneBuilder = clonedDiv.querySelector(this.container);
|
113236
|
+
cloneBuilder.innerHTML = '';
|
113237
|
+
box.appendChild(clonedDiv);
|
113238
|
+
const range = document.createRange();
|
113239
|
+
cloneBuilder.appendChild(range.createContextualFragment(html));
|
113240
|
+
this.applyBehaviorOn(cloneBuilder);
|
113241
|
+
cloneBuilder.click();
|
113242
|
+
} else {
|
113243
|
+
block.parentNode.appendChild(clonedDiv);
|
113244
|
+
}
|
113245
|
+
block.classList.remove('active');
|
113246
|
+
this.doc.querySelectorAll('.clone').forEach(elm => elm.parentNode.removeChild(elm));
|
113247
|
+
this.doc.querySelectorAll('.cloned').forEach(elm => elm.classList.remove('cloned'));
|
113248
|
+
this.eb.refresh();
|
113249
|
+
this.opts.onChange();
|
113250
|
+
}
|
113251
|
+
}
|
113252
|
+
};
|
113253
|
+
|
113559
113254
|
// SHIFT + Right Clidk to Zoom In
|
113560
113255
|
if (this.canvas && !this.isContentBox && this.docContainer && !this.iframe) {
|
113561
113256
|
//--- see loadHtml ---
|
@@ -113627,52 +113322,40 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
113627
113322
|
document.addEventListener('keydown', e => {
|
113628
113323
|
if ((e.ctrlKey || e.metaKey) && e.which === 67) {
|
113629
113324
|
//CTRL-C
|
113630
|
-
|
113631
|
-
if (activeBlock) {
|
113632
|
-
this.copyBlock = activeBlock;
|
113633
|
-
}
|
113325
|
+
copyBlock(e);
|
113634
113326
|
}
|
113635
113327
|
});
|
113636
113328
|
document.addEventListener('keydown', e => {
|
113637
113329
|
if ((e.ctrlKey || e.metaKey) && e.which === 86) {
|
113638
113330
|
//CTRL-V
|
113639
|
-
|
113640
|
-
|
113641
|
-
|
113642
|
-
|
113643
|
-
|
113644
|
-
|
113645
|
-
|
113646
|
-
|
113647
|
-
|
113648
|
-
let block = this.copyBlock;
|
113649
|
-
const builder = block.querySelector(this.container);
|
113650
|
-
let html = '';
|
113651
|
-
if (builder) {
|
113652
|
-
html = this.readHtml(builder);
|
113653
|
-
}
|
113654
|
-
let clonedDiv = block.cloneNode(true);
|
113655
|
-
clonedDiv.style.top = '20%';
|
113656
|
-
clonedDiv.style.left = '20%';
|
113657
|
-
if (builder) {
|
113658
|
-
const cloneBuilder = clonedDiv.querySelector(this.container);
|
113659
|
-
cloneBuilder.innerHTML = '';
|
113660
|
-
box.appendChild(clonedDiv);
|
113661
|
-
const range = document.createRange();
|
113662
|
-
cloneBuilder.appendChild(range.createContextualFragment(html));
|
113663
|
-
this.applyBehaviorOn(cloneBuilder);
|
113664
|
-
cloneBuilder.click();
|
113665
|
-
} else {
|
113666
|
-
block.parentNode.appendChild(clonedDiv);
|
113667
|
-
}
|
113668
|
-
block.classList.remove('active');
|
113669
|
-
this.doc.querySelectorAll('.clone').forEach(elm => elm.parentNode.removeChild(elm));
|
113670
|
-
this.doc.querySelectorAll('.cloned').forEach(elm => elm.classList.remove('cloned'));
|
113671
|
-
this.eb.refresh();
|
113672
|
-
this.opts.onChange();
|
113673
|
-
}
|
113331
|
+
pasteBlock(e);
|
113332
|
+
}
|
113333
|
+
});
|
113334
|
+
}
|
113335
|
+
if (this.canvas && this.isContentBox) {
|
113336
|
+
// Copy & Paste Block
|
113337
|
+
document.addEventListener('keydown', e => {
|
113338
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 67) {
|
113339
|
+
copyBlock(e);
|
113674
113340
|
}
|
113675
113341
|
});
|
113342
|
+
document.addEventListener('keydown', e => {
|
113343
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 86) {
|
113344
|
+
pasteBlock(e);
|
113345
|
+
}
|
113346
|
+
});
|
113347
|
+
if (this.iframe) {
|
113348
|
+
this.doc.addEventListener('keydown', e => {
|
113349
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 67) {
|
113350
|
+
copyBlock(e);
|
113351
|
+
}
|
113352
|
+
});
|
113353
|
+
this.doc.addEventListener('keydown', e => {
|
113354
|
+
if ((e.ctrlKey || e.metaKey) && e.which === 86) {
|
113355
|
+
pasteBlock(e);
|
113356
|
+
}
|
113357
|
+
});
|
113358
|
+
}
|
113676
113359
|
}
|
113677
113360
|
let previousWidth = this.win.innerWidth;
|
113678
113361
|
let timer;
|
@@ -114921,22 +114604,21 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
114921
114604
|
// Hide element tool
|
114922
114605
|
this.elmTool.hide();
|
114923
114606
|
|
114924
|
-
//
|
114925
|
-
|
114926
|
-
|
114927
|
-
|
114928
|
-
|
114929
|
-
|
114930
|
-
|
114931
|
-
|
114932
|
-
|
114933
|
-
|
114934
|
-
|
114935
|
-
|
114607
|
+
// destroy (extra)
|
114608
|
+
if (this.sortableOnCanvas) {
|
114609
|
+
this.sortableOnCanvas.forEach(obj => {
|
114610
|
+
if (obj) {
|
114611
|
+
obj.destroy();
|
114612
|
+
}
|
114613
|
+
});
|
114614
|
+
let dummies = this.doc.querySelectorAll('.block-dummy');
|
114615
|
+
dummies.forEach(elm => elm.parentNode.removeChild(elm));
|
114616
|
+
this.sortableOnCanvas = [];
|
114617
|
+
}
|
114618
|
+
if (this.sortableOnPage) this.sortableOnPage.destroy();
|
114936
114619
|
}
|
114937
114620
|
}
|
114938
114621
|
});
|
114939
|
-
|
114940
114622
|
this.sortableObjects.push(sortableObject);
|
114941
114623
|
builder.setAttribute('data-sort', true);
|
114942
114624
|
}
|
@@ -118095,9 +117777,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118095
117777
|
bw = '540px';
|
118096
117778
|
}
|
118097
117779
|
}
|
117780
|
+
let containerClass = ''; // container's 'size-18 leading-14' is not for print
|
117781
|
+
if (this.isContentBox) containerClass = ' size-18 leading-14';
|
118098
117782
|
const blockTemplate = `
|
118099
117783
|
<div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: ${bw};">
|
118100
|
-
<div class="is-container container-new">
|
117784
|
+
<div class="is-container container-new${containerClass}">
|
118101
117785
|
[%CONTENT%]
|
118102
117786
|
</div>
|
118103
117787
|
</div>
|
@@ -118147,9 +117831,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118147
117831
|
bw = '540px';
|
118148
117832
|
}
|
118149
117833
|
}
|
117834
|
+
let containerClass = ''; // container's 'size-18 leading-14' is not for print
|
117835
|
+
if (this.isContentBox) containerClass = ' size-18 leading-14';
|
118150
117836
|
const blockTemplate = `
|
118151
117837
|
<div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: ${bw};">
|
118152
|
-
<div class="is-container container-new">
|
117838
|
+
<div class="is-container container-new${containerClass}">
|
118153
117839
|
[%CONTENT%]
|
118154
117840
|
</div>
|
118155
117841
|
</div>
|
@@ -118185,6 +117871,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118185
117871
|
});
|
118186
117872
|
let dummies = this.doc.querySelectorAll('.block-dummy');
|
118187
117873
|
dummies.forEach(elm => elm.parentNode.removeChild(elm));
|
117874
|
+
this.sortableOnCanvas = [];
|
118188
117875
|
}
|
118189
117876
|
if (this.sortableOnPage) this.sortableOnPage.destroy();
|
118190
117877
|
}
|
@@ -118251,6 +117938,18 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118251
117938
|
// //Trigger Render event
|
118252
117939
|
// this.opts.onRender();
|
118253
117940
|
|
117941
|
+
// destroy (new)
|
117942
|
+
if (this.sortableOnCanvas) {
|
117943
|
+
this.sortableOnCanvas.forEach(obj => {
|
117944
|
+
if (obj) {
|
117945
|
+
obj.destroy();
|
117946
|
+
}
|
117947
|
+
});
|
117948
|
+
let dummies = this.doc.querySelectorAll('.block-dummy');
|
117949
|
+
dummies.forEach(elm => elm.parentNode.removeChild(elm));
|
117950
|
+
this.sortableOnCanvas = [];
|
117951
|
+
}
|
117952
|
+
if (this.sortableOnPage) this.sortableOnPage.destroy();
|
118254
117953
|
return;
|
118255
117954
|
}
|
118256
117955
|
if (itemEl.getAttribute('data-id')) {
|
@@ -118402,6 +118101,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118402
118101
|
});
|
118403
118102
|
let dummies = this.doc.querySelectorAll('.block-dummy');
|
118404
118103
|
dummies.forEach(elm => elm.parentNode.removeChild(elm));
|
118104
|
+
this.sortableOnCanvas = [];
|
118405
118105
|
}
|
118406
118106
|
if (this.sortableOnPage) this.sortableOnPage.destroy();
|
118407
118107
|
}
|
@@ -133679,6 +133379,8 @@ class Section {
|
|
133679
133379
|
this.builder.activeBox = section.querySelector('.box-select');
|
133680
133380
|
}
|
133681
133381
|
|
133382
|
+
if (this.builder.eb) this.builder.eb.refresh(); // freeform
|
133383
|
+
|
133682
133384
|
this.builder.onRender();
|
133683
133385
|
this.builder.onChange();
|
133684
133386
|
}
|
@@ -145562,7 +145264,7 @@ class ContentBox {
|
|
145562
145264
|
toolbar: 'top',
|
145563
145265
|
toolbarDisplay: 'auto',
|
145564
145266
|
toolbarAddSnippetButton: false,
|
145565
|
-
paste: '
|
145267
|
+
paste: 'text',
|
145566
145268
|
builderMode: '',
|
145567
145269
|
rowcolOutline: true,
|
145568
145270
|
elementSelection: true,
|
@@ -148925,6 +148627,7 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
148925
148627
|
this.editor = new ContentBuilder({
|
148926
148628
|
controlPanel: this.settings.controlPanel,
|
148927
148629
|
canvas: this.settings.canvas,
|
148630
|
+
docContainer: this.settings.wrapper,
|
148928
148631
|
consoleLog: this.settings.consoleLog,
|
148929
148632
|
isContentBox: true,
|
148930
148633
|
speechTranscribeUrl: this.settings.speechTranscribeUrl,
|