").appendTo(this._appendTo());
-
- this._addClass(this.overlay, null, "ui-widget-overlay ui-front");
-
- this._on(this.overlay, {
- mousedown: "_keepFocus"
- });
-
- this.document.data("ui-dialog-overlays", (this.document.data("ui-dialog-overlays") || 0) + 1);
- },
- _destroyOverlay: function _destroyOverlay() {
- if (!this.options.modal) {
- return;
- }
-
- if (this.overlay) {
- var overlays = this.document.data("ui-dialog-overlays") - 1;
-
- if (!overlays) {
- this.document.off("focusin.ui-dialog");
- this.document.removeData("ui-dialog-overlays");
- } else {
- this.document.data("ui-dialog-overlays", overlays);
- }
-
- this.overlay.remove();
- this.overlay = null;
- }
- }
- }); // DEPRECATED
- // TODO: switch return back to widget declaration at top of file when this is removed
-
- if ($.uiBackCompat !== false) {
- // Backcompat for dialogClass option
- $.widget("ui.dialog", $.ui.dialog, {
- options: {
- dialogClass: ""
- },
- _createWrapper: function _createWrapper() {
- this._super();
-
- this.uiDialog.addClass(this.options.dialogClass);
- },
- _setOption: function _setOption(key, value) {
- if (key === "dialogClass") {
- this.uiDialog.removeClass(this.options.dialogClass).addClass(value);
- }
-
- this._superApply(arguments);
- }
- });
- }
-
- return $.ui.dialog;
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ui/ui/widgets/draggable.js":
-/*!********************************************************!*\
- !*** ./node_modules/jquery-ui/ui/widgets/draggable.js ***!
- \********************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery UI Draggable 1.13.1
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-//>>label: Draggable
-//>>group: Interactions
-//>>description: Enables dragging functionality for any element.
-//>>docs: http://api.jqueryui.com/draggable/
-//>>demos: http://jqueryui.com/draggable/
-//>>css.structure: ../../themes/base/draggable.css
-(function (factory) {
- "use strict";
-
- if (true) {
- // AMD. Register as an anonymous module.
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! ./mouse */ "./node_modules/jquery-ui/ui/widgets/mouse.js"), __webpack_require__(/*! ../data */ "./node_modules/jquery-ui/ui/data.js"), __webpack_require__(/*! ../plugin */ "./node_modules/jquery-ui/ui/plugin.js"), __webpack_require__(/*! ../safe-active-element */ "./node_modules/jquery-ui/ui/safe-active-element.js"), __webpack_require__(/*! ../safe-blur */ "./node_modules/jquery-ui/ui/safe-blur.js"), __webpack_require__(/*! ../scroll-parent */ "./node_modules/jquery-ui/ui/scroll-parent.js"), __webpack_require__(/*! ../version */ "./node_modules/jquery-ui/ui/version.js"), __webpack_require__(/*! ../widget */ "./node_modules/jquery-ui/ui/widget.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-})(function ($) {
- "use strict";
-
- $.widget("ui.draggable", $.ui.mouse, {
- version: "1.13.1",
- widgetEventPrefix: "drag",
- options: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false,
- // Callbacks
- drag: null,
- start: null,
- stop: null
- },
- _create: function _create() {
- if (this.options.helper === "original") {
- this._setPositionRelative();
- }
-
- if (this.options.addClasses) {
- this._addClass("ui-draggable");
- }
-
- this._setHandleClassName();
-
- this._mouseInit();
- },
- _setOption: function _setOption(key, value) {
- this._super(key, value);
-
- if (key === "handle") {
- this._removeHandleClassName();
-
- this._setHandleClassName();
- }
- },
- _destroy: function _destroy() {
- if ((this.helper || this.element).is(".ui-draggable-dragging")) {
- this.destroyOnClear = true;
- return;
- }
-
- this._removeHandleClassName();
-
- this._mouseDestroy();
- },
- _mouseCapture: function _mouseCapture(event) {
- var o = this.options; // Among others, prevent a drag on a resizable-handle
-
- if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
- return false;
- } //Quit if we're not on a valid handle
-
-
- this.handle = this._getHandle(event);
-
- if (!this.handle) {
- return false;
- }
-
- this._blurActiveElement(event);
-
- this._blockFrames(o.iframeFix === true ? "iframe" : o.iframeFix);
-
- return true;
- },
- _blockFrames: function _blockFrames(selector) {
- this.iframeBlocks = this.document.find(selector).map(function () {
- var iframe = $(this);
- return $("
").css("position", "absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];
- });
- },
- _unblockFrames: function _unblockFrames() {
- if (this.iframeBlocks) {
- this.iframeBlocks.remove();
- delete this.iframeBlocks;
- }
- },
- _blurActiveElement: function _blurActiveElement(event) {
- var activeElement = $.ui.safeActiveElement(this.document[0]),
- target = $(event.target); // Don't blur if the event occurred on an element that is within
- // the currently focused element
- // See #10527, #12472
-
- if (target.closest(activeElement).length) {
- return;
- } // Blur any element that currently has focus, see #4261
-
-
- $.ui.safeBlur(activeElement);
- },
- _mouseStart: function _mouseStart(event) {
- var o = this.options; //Create and append the visible helper
-
- this.helper = this._createHelper(event);
-
- this._addClass(this.helper, "ui-draggable-dragging"); //Cache the helper size
-
-
- this._cacheHelperProportions(); //If ddmanager is used for droppables, set the global draggable
-
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.current = this;
- }
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
- //Cache the margins of the original element
-
-
- this._cacheMargins(); //Store the helper's css position
-
-
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent(true);
- this.offsetParent = this.helper.offsetParent();
- this.hasFixedAncestor = this.helper.parents().filter(function () {
- return $(this).css("position") === "fixed";
- }).length > 0; //The element's absolute position on the page minus margins
-
- this.positionAbs = this.element.offset();
-
- this._refreshOffsets(event); //Generate the original position
-
-
- this.originalPosition = this.position = this._generatePosition(event, false);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY; //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
-
- if (o.cursorAt) {
- this._adjustOffsetFromHelper(o.cursorAt);
- } //Set a containment if given in the options
-
-
- this._setContainment(); //Trigger event + callbacks
-
-
- if (this._trigger("start", event) === false) {
- this._clear();
-
- return false;
- } //Recache the helper size
-
-
- this._cacheHelperProportions(); //Prepare the droppable offsets
-
-
- if ($.ui.ddmanager && !o.dropBehaviour) {
- $.ui.ddmanager.prepareOffsets(this, event);
- } // Execute the drag once - this causes the helper not to be visible before getting its
- // correct position
-
-
- this._mouseDrag(event, true); // If the ddmanager is used for droppables, inform the manager that dragging has started
- // (see #5003)
-
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.dragStart(this, event);
- }
-
- return true;
- },
- _refreshOffsets: function _refreshOffsets(event) {
- this.offset = {
- top: this.positionAbs.top - this.margins.top,
- left: this.positionAbs.left - this.margins.left,
- scroll: false,
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset()
- };
- this.offset.click = {
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- };
- },
- _mouseDrag: function _mouseDrag(event, noPropagation) {
- // reset any necessary cached properties (see #5009)
- if (this.hasFixedAncestor) {
- this.offset.parent = this._getParentOffset();
- } //Compute the helpers position
-
-
- this.position = this._generatePosition(event, true);
- this.positionAbs = this._convertPositionTo("absolute"); //Call plugins and callbacks and use the resulting position if something is returned
-
- if (!noPropagation) {
- var ui = this._uiHash();
-
- if (this._trigger("drag", event, ui) === false) {
- this._mouseUp(new $.Event("mouseup", event));
-
- return false;
- }
-
- this.position = ui.position;
- }
-
- this.helper[0].style.left = this.position.left + "px";
- this.helper[0].style.top = this.position.top + "px";
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.drag(this, event);
- }
-
- return false;
- },
- _mouseStop: function _mouseStop(event) {
- //If we are using droppables, inform the manager about the drop
- var that = this,
- dropped = false;
-
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
- dropped = $.ui.ddmanager.drop(this, event);
- } //if a drop comes from outside (a sortable)
-
-
- if (this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- if (this.options.revert === "invalid" && !dropped || this.options.revert === "valid" && dropped || this.options.revert === true || typeof this.options.revert === "function" && this.options.revert.call(this.element, dropped)) {
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
- if (that._trigger("stop", event) !== false) {
- that._clear();
- }
- });
- } else {
- if (this._trigger("stop", event) !== false) {
- this._clear();
- }
- }
-
- return false;
- },
- _mouseUp: function _mouseUp(event) {
- this._unblockFrames(); // If the ddmanager is used for droppables, inform the manager that dragging has stopped
- // (see #5003)
-
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.dragStop(this, event);
- } // Only need to focus if the event occurred on the draggable itself, see #10527
-
-
- if (this.handleElement.is(event.target)) {
- // The interaction is over; whether or not the click resulted in a drag,
- // focus the element
- this.element.trigger("focus");
- }
-
- return $.ui.mouse.prototype._mouseUp.call(this, event);
- },
- cancel: function cancel() {
- if (this.helper.is(".ui-draggable-dragging")) {
- this._mouseUp(new $.Event("mouseup", {
- target: this.element[0]
- }));
- } else {
- this._clear();
- }
-
- return this;
- },
- _getHandle: function _getHandle(event) {
- return this.options.handle ? !!$(event.target).closest(this.element.find(this.options.handle)).length : true;
- },
- _setHandleClassName: function _setHandleClassName() {
- this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element;
-
- this._addClass(this.handleElement, "ui-draggable-handle");
- },
- _removeHandleClassName: function _removeHandleClassName() {
- this._removeClass(this.handleElement, "ui-draggable-handle");
- },
- _createHelper: function _createHelper(event) {
- var o = this.options,
- helperIsFunction = typeof o.helper === "function",
- helper = helperIsFunction ? $(o.helper.apply(this.element[0], [event])) : o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element;
-
- if (!helper.parents("body").length) {
- helper.appendTo(o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo);
- } // Http://bugs.jqueryui.com/ticket/9446
- // a helper function can return the original element
- // which wouldn't have been set to relative in _create
-
-
- if (helperIsFunction && helper[0] === this.element[0]) {
- this._setPositionRelative();
- }
-
- if (helper[0] !== this.element[0] && !/(fixed|absolute)/.test(helper.css("position"))) {
- helper.css("position", "absolute");
- }
-
- return helper;
- },
- _setPositionRelative: function _setPositionRelative() {
- if (!/^(?:r|a|f)/.test(this.element.css("position"))) {
- this.element[0].style.position = "relative";
- }
- },
- _adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {
- if (typeof obj === "string") {
- obj = obj.split(" ");
- }
-
- if (Array.isArray(obj)) {
- obj = {
- left: +obj[0],
- top: +obj[1] || 0
- };
- }
-
- if ("left" in obj) {
- this.offset.click.left = obj.left + this.margins.left;
- }
-
- if ("right" in obj) {
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- }
-
- if ("top" in obj) {
- this.offset.click.top = obj.top + this.margins.top;
- }
-
- if ("bottom" in obj) {
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- }
- },
- _isRootNode: function _isRootNode(element) {
- return /(html|body)/i.test(element.tagName) || element === this.document[0];
- },
- _getParentOffset: function _getParentOffset() {
- //Get the offsetParent and cache its position
- var po = this.offsetParent.offset(),
- document = this.document[0]; // This is a special case where we need to modify a offset calculated on start, since the
- // following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the
- // next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
- // the document, which means that the scroll is included in the initial calculation of the
- // offset of the parent, and never recalculated upon drag
-
- if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if (this._isRootNode(this.offsetParent[0])) {
- po = {
- top: 0,
- left: 0
- };
- }
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
- };
- },
- _getRelativeOffset: function _getRelativeOffset() {
- if (this.cssPosition !== "relative") {
- return {
- top: 0,
- left: 0
- };
- }
-
- var p = this.element.position(),
- scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
-
- return {
- top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
- left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0)
- };
- },
- _cacheMargins: function _cacheMargins() {
- this.margins = {
- left: parseInt(this.element.css("marginLeft"), 10) || 0,
- top: parseInt(this.element.css("marginTop"), 10) || 0,
- right: parseInt(this.element.css("marginRight"), 10) || 0,
- bottom: parseInt(this.element.css("marginBottom"), 10) || 0
- };
- },
- _cacheHelperProportions: function _cacheHelperProportions() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
- _setContainment: function _setContainment() {
- var isUserScrollable,
- c,
- ce,
- o = this.options,
- document = this.document[0];
- this.relativeContainer = null;
-
- if (!o.containment) {
- this.containment = null;
- return;
- }
-
- if (o.containment === "window") {
- this.containment = [$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, $(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, $(window).scrollTop() + ($(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
- return;
- }
-
- if (o.containment === "document") {
- this.containment = [0, 0, $(document).width() - this.helperProportions.width - this.margins.left, ($(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
- return;
- }
-
- if (o.containment.constructor === Array) {
- this.containment = o.containment;
- return;
- }
-
- if (o.containment === "parent") {
- o.containment = this.helper[0].parentNode;
- }
-
- c = $(o.containment);
- ce = c[0];
-
- if (!ce) {
- return;
- }
-
- isUserScrollable = /(scroll|auto)/.test(c.css("overflow"));
- this.containment = [(parseInt(c.css("borderLeftWidth"), 10) || 0) + (parseInt(c.css("paddingLeft"), 10) || 0), (parseInt(c.css("borderTopWidth"), 10) || 0) + (parseInt(c.css("paddingTop"), 10) || 0), (isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10) || 0) - (parseInt(c.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10) || 0) - (parseInt(c.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom];
- this.relativeContainer = c;
- },
- _convertPositionTo: function _convertPositionTo(d, pos) {
- if (!pos) {
- pos = this.position;
- }
-
- var mod = d === "absolute" ? 1 : -1,
- scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
-
- return {
- top: // The absolute mouse position
- pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border)
- this.offset.parent.top * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top) * mod,
- left: // The absolute mouse position
- pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border)
- this.offset.parent.left * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left) * mod
- };
- },
- _generatePosition: function _generatePosition(event, constrainPosition) {
- var containment,
- co,
- top,
- left,
- o = this.options,
- scrollIsRootNode = this._isRootNode(this.scrollParent[0]),
- pageX = event.pageX,
- pageY = event.pageY; // Cache the scroll
-
-
- if (!scrollIsRootNode || !this.offset.scroll) {
- this.offset.scroll = {
- top: this.scrollParent.scrollTop(),
- left: this.scrollParent.scrollLeft()
- };
- }
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- // If we are not dragging yet, we won't check for options
-
-
- if (constrainPosition) {
- if (this.containment) {
- if (this.relativeContainer) {
- co = this.relativeContainer.offset();
- containment = [this.containment[0] + co.left, this.containment[1] + co.top, this.containment[2] + co.left, this.containment[3] + co.top];
- } else {
- containment = this.containment;
- }
-
- if (event.pageX - this.offset.click.left < containment[0]) {
- pageX = containment[0] + this.offset.click.left;
- }
-
- if (event.pageY - this.offset.click.top < containment[1]) {
- pageY = containment[1] + this.offset.click.top;
- }
-
- if (event.pageX - this.offset.click.left > containment[2]) {
- pageX = containment[2] + this.offset.click.left;
- }
-
- if (event.pageY - this.offset.click.top > containment[3]) {
- pageY = containment[3] + this.offset.click.top;
- }
- }
-
- if (o.grid) {
- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid
- // argument errors in IE (see ticket #6950)
- top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
- pageY = containment ? top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3] ? top : top - this.offset.click.top >= containment[1] ? top - o.grid[1] : top + o.grid[1] : top;
- left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
- pageX = containment ? left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2] ? left : left - this.offset.click.left >= containment[0] ? left - o.grid[0] : left + o.grid[0] : left;
- }
-
- if (o.axis === "y") {
- pageX = this.originalPageX;
- }
-
- if (o.axis === "x") {
- pageY = this.originalPageY;
- }
- }
-
- return {
- top: // The absolute mouse position
- pageY - // Click offset (relative to the element)
- this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.top - // The offsetParent's offset without borders (offset + border)
- this.offset.parent.top + (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top),
- left: // The absolute mouse position
- pageX - // Click offset (relative to the element)
- this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.left - // The offsetParent's offset without borders (offset + border)
- this.offset.parent.left + (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left)
- };
- },
- _clear: function _clear() {
- this._removeClass(this.helper, "ui-draggable-dragging");
-
- if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
- this.helper.remove();
- }
-
- this.helper = null;
- this.cancelHelperRemoval = false;
-
- if (this.destroyOnClear) {
- this.destroy();
- }
- },
- // From now on bulk stuff - mainly helpers
- _trigger: function _trigger(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui, this], true); // Absolute position and offset (see #6884 ) have to be recalculated after plugins
-
- if (/^(drag|start|stop)/.test(type)) {
- this.positionAbs = this._convertPositionTo("absolute");
- ui.offset = this.positionAbs;
- }
-
- return $.Widget.prototype._trigger.call(this, type, event, ui);
- },
- plugins: {},
- _uiHash: function _uiHash() {
- return {
- helper: this.helper,
- position: this.position,
- originalPosition: this.originalPosition,
- offset: this.positionAbs
- };
- }
- });
- $.ui.plugin.add("draggable", "connectToSortable", {
- start: function start(event, ui, draggable) {
- var uiSortable = $.extend({}, ui, {
- item: draggable.element
- });
- draggable.sortables = [];
- $(draggable.options.connectToSortable).each(function () {
- var sortable = $(this).sortable("instance");
-
- if (sortable && !sortable.options.disabled) {
- draggable.sortables.push(sortable); // RefreshPositions is called at drag start to refresh the containerCache
- // which is used in drag. This ensures it's initialized and synchronized
- // with any changes that might have happened on the page since initialization.
-
- sortable.refreshPositions();
-
- sortable._trigger("activate", event, uiSortable);
- }
- });
- },
- stop: function stop(event, ui, draggable) {
- var uiSortable = $.extend({}, ui, {
- item: draggable.element
- });
- draggable.cancelHelperRemoval = false;
- $.each(draggable.sortables, function () {
- var sortable = this;
-
- if (sortable.isOver) {
- sortable.isOver = 0; // Allow this sortable to handle removing the helper
-
- draggable.cancelHelperRemoval = true;
- sortable.cancelHelperRemoval = false; // Use _storedCSS To restore properties in the sortable,
- // as this also handles revert (#9675) since the draggable
- // may have modified them in unexpected ways (#8809)
-
- sortable._storedCSS = {
- position: sortable.placeholder.css("position"),
- top: sortable.placeholder.css("top"),
- left: sortable.placeholder.css("left")
- };
-
- sortable._mouseStop(event); // Once drag has ended, the sortable should return to using
- // its original helper, not the shared helper from draggable
-
-
- sortable.options.helper = sortable.options._helper;
- } else {
- // Prevent this Sortable from removing the helper.
- // However, don't set the draggable to remove the helper
- // either as another connected Sortable may yet handle the removal.
- sortable.cancelHelperRemoval = true;
-
- sortable._trigger("deactivate", event, uiSortable);
- }
- });
- },
- drag: function drag(event, ui, draggable) {
- $.each(draggable.sortables, function () {
- var innermostIntersecting = false,
- sortable = this; // Copy over variables that sortable's _intersectsWith uses
-
- sortable.positionAbs = draggable.positionAbs;
- sortable.helperProportions = draggable.helperProportions;
- sortable.offset.click = draggable.offset.click;
-
- if (sortable._intersectsWith(sortable.containerCache)) {
- innermostIntersecting = true;
- $.each(draggable.sortables, function () {
- // Copy over variables that sortable's _intersectsWith uses
- this.positionAbs = draggable.positionAbs;
- this.helperProportions = draggable.helperProportions;
- this.offset.click = draggable.offset.click;
-
- if (this !== sortable && this._intersectsWith(this.containerCache) && $.contains(sortable.element[0], this.element[0])) {
- innermostIntersecting = false;
- }
-
- return innermostIntersecting;
- });
- }
-
- if (innermostIntersecting) {
- // If it intersects, we use a little isOver variable and set it once,
- // so that the move-in stuff gets fired only once.
- if (!sortable.isOver) {
- sortable.isOver = 1; // Store draggable's parent in case we need to reappend to it later.
-
- draggable._parent = ui.helper.parent();
- sortable.currentItem = ui.helper.appendTo(sortable.element).data("ui-sortable-item", true); // Store helper option to later restore it
-
- sortable.options._helper = sortable.options.helper;
-
- sortable.options.helper = function () {
- return ui.helper[0];
- }; // Fire the start events of the sortable with our passed browser event,
- // and our own helper (so it doesn't create a new one)
-
-
- event.target = sortable.currentItem[0];
-
- sortable._mouseCapture(event, true);
-
- sortable._mouseStart(event, true, true); // Because the browser event is way off the new appended portlet,
- // modify necessary variables to reflect the changes
-
-
- sortable.offset.click.top = draggable.offset.click.top;
- sortable.offset.click.left = draggable.offset.click.left;
- sortable.offset.parent.left -= draggable.offset.parent.left - sortable.offset.parent.left;
- sortable.offset.parent.top -= draggable.offset.parent.top - sortable.offset.parent.top;
-
- draggable._trigger("toSortable", event); // Inform draggable that the helper is in a valid drop zone,
- // used solely in the revert option to handle "valid/invalid".
-
-
- draggable.dropped = sortable.element; // Need to refreshPositions of all sortables in the case that
- // adding to one sortable changes the location of the other sortables (#9675)
-
- $.each(draggable.sortables, function () {
- this.refreshPositions();
- }); // Hack so receive/update callbacks work (mostly)
-
- draggable.currentItem = draggable.element;
- sortable.fromOutside = draggable;
- }
-
- if (sortable.currentItem) {
- sortable._mouseDrag(event); // Copy the sortable's position because the draggable's can potentially reflect
- // a relative position, while sortable is always absolute, which the dragged
- // element has now become. (#8809)
-
-
- ui.position = sortable.position;
- }
- } else {
- // If it doesn't intersect with the sortable, and it intersected before,
- // we fake the drag stop of the sortable, but make sure it doesn't remove
- // the helper by using cancelHelperRemoval.
- if (sortable.isOver) {
- sortable.isOver = 0;
- sortable.cancelHelperRemoval = true; // Calling sortable's mouseStop would trigger a revert,
- // so revert must be temporarily false until after mouseStop is called.
-
- sortable.options._revert = sortable.options.revert;
- sortable.options.revert = false;
-
- sortable._trigger("out", event, sortable._uiHash(sortable));
-
- sortable._mouseStop(event, true); // Restore sortable behaviors that were modfied
- // when the draggable entered the sortable area (#9481)
-
-
- sortable.options.revert = sortable.options._revert;
- sortable.options.helper = sortable.options._helper;
-
- if (sortable.placeholder) {
- sortable.placeholder.remove();
- } // Restore and recalculate the draggable's offset considering the sortable
- // may have modified them in unexpected ways. (#8809, #10669)
-
-
- ui.helper.appendTo(draggable._parent);
-
- draggable._refreshOffsets(event);
-
- ui.position = draggable._generatePosition(event, true);
-
- draggable._trigger("fromSortable", event); // Inform draggable that the helper is no longer in a valid drop zone
-
-
- draggable.dropped = false; // Need to refreshPositions of all sortables just in case removing
- // from one sortable changes the location of other sortables (#9675)
-
- $.each(draggable.sortables, function () {
- this.refreshPositions();
- });
- }
- }
- });
- }
- });
- $.ui.plugin.add("draggable", "cursor", {
- start: function start(event, ui, instance) {
- var t = $("body"),
- o = instance.options;
-
- if (t.css("cursor")) {
- o._cursor = t.css("cursor");
- }
-
- t.css("cursor", o.cursor);
- },
- stop: function stop(event, ui, instance) {
- var o = instance.options;
-
- if (o._cursor) {
- $("body").css("cursor", o._cursor);
- }
- }
- });
- $.ui.plugin.add("draggable", "opacity", {
- start: function start(event, ui, instance) {
- var t = $(ui.helper),
- o = instance.options;
-
- if (t.css("opacity")) {
- o._opacity = t.css("opacity");
- }
-
- t.css("opacity", o.opacity);
- },
- stop: function stop(event, ui, instance) {
- var o = instance.options;
-
- if (o._opacity) {
- $(ui.helper).css("opacity", o._opacity);
- }
- }
- });
- $.ui.plugin.add("draggable", "scroll", {
- start: function start(event, ui, i) {
- if (!i.scrollParentNotHidden) {
- i.scrollParentNotHidden = i.helper.scrollParent(false);
- }
-
- if (i.scrollParentNotHidden[0] !== i.document[0] && i.scrollParentNotHidden[0].tagName !== "HTML") {
- i.overflowOffset = i.scrollParentNotHidden.offset();
- }
- },
- drag: function drag(event, ui, i) {
- var o = i.options,
- scrolled = false,
- scrollParent = i.scrollParentNotHidden[0],
- document = i.document[0];
-
- if (scrollParent !== document && scrollParent.tagName !== "HTML") {
- if (!o.axis || o.axis !== "x") {
- if (i.overflowOffset.top + scrollParent.offsetHeight - event.pageY < o.scrollSensitivity) {
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
- } else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
- }
- }
-
- if (!o.axis || o.axis !== "y") {
- if (i.overflowOffset.left + scrollParent.offsetWidth - event.pageX < o.scrollSensitivity) {
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
- } else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
- }
- }
- } else {
- if (!o.axis || o.axis !== "x") {
- if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
- }
-
- if (!o.axis || o.axis !== "y") {
- if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
- }
- }
-
- if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
- $.ui.ddmanager.prepareOffsets(i, event);
- }
- }
- });
- $.ui.plugin.add("draggable", "snap", {
- start: function start(event, ui, i) {
- var o = i.options;
- i.snapElements = [];
- $(o.snap.constructor !== String ? o.snap.items || ":data(ui-draggable)" : o.snap).each(function () {
- var $t = $(this),
- $o = $t.offset();
-
- if (this !== i.element[0]) {
- i.snapElements.push({
- item: this,
- width: $t.outerWidth(),
- height: $t.outerHeight(),
- top: $o.top,
- left: $o.left
- });
- }
- });
- },
- drag: function drag(event, ui, inst) {
- var ts,
- bs,
- ls,
- rs,
- l,
- r,
- t,
- b,
- i,
- first,
- o = inst.options,
- d = o.snapTolerance,
- x1 = ui.offset.left,
- x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top,
- y2 = y1 + inst.helperProportions.height;
-
- for (i = inst.snapElements.length - 1; i >= 0; i--) {
- l = inst.snapElements[i].left - inst.margins.left;
- r = l + inst.snapElements[i].width;
- t = inst.snapElements[i].top - inst.margins.top;
- b = t + inst.snapElements[i].height;
-
- if (x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains(inst.snapElements[i].item.ownerDocument, inst.snapElements[i].item)) {
- if (inst.snapElements[i].snapping) {
- if (inst.options.snap.release) {
- inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), {
- snapItem: inst.snapElements[i].item
- }));
- }
- }
-
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if (o.snapMode !== "inner") {
- ts = Math.abs(t - y2) <= d;
- bs = Math.abs(b - y1) <= d;
- ls = Math.abs(l - x2) <= d;
- rs = Math.abs(r - x1) <= d;
-
- if (ts) {
- ui.position.top = inst._convertPositionTo("relative", {
- top: t - inst.helperProportions.height,
- left: 0
- }).top;
- }
-
- if (bs) {
- ui.position.top = inst._convertPositionTo("relative", {
- top: b,
- left: 0
- }).top;
- }
-
- if (ls) {
- ui.position.left = inst._convertPositionTo("relative", {
- top: 0,
- left: l - inst.helperProportions.width
- }).left;
- }
-
- if (rs) {
- ui.position.left = inst._convertPositionTo("relative", {
- top: 0,
- left: r
- }).left;
- }
- }
-
- first = ts || bs || ls || rs;
-
- if (o.snapMode !== "outer") {
- ts = Math.abs(t - y1) <= d;
- bs = Math.abs(b - y2) <= d;
- ls = Math.abs(l - x1) <= d;
- rs = Math.abs(r - x2) <= d;
-
- if (ts) {
- ui.position.top = inst._convertPositionTo("relative", {
- top: t,
- left: 0
- }).top;
- }
-
- if (bs) {
- ui.position.top = inst._convertPositionTo("relative", {
- top: b - inst.helperProportions.height,
- left: 0
- }).top;
- }
-
- if (ls) {
- ui.position.left = inst._convertPositionTo("relative", {
- top: 0,
- left: l
- }).left;
- }
-
- if (rs) {
- ui.position.left = inst._convertPositionTo("relative", {
- top: 0,
- left: r - inst.helperProportions.width
- }).left;
- }
- }
-
- if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
- if (inst.options.snap.snap) {
- inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), {
- snapItem: inst.snapElements[i].item
- }));
- }
- }
-
- inst.snapElements[i].snapping = ts || bs || ls || rs || first;
- }
- }
- });
- $.ui.plugin.add("draggable", "stack", {
- start: function start(event, ui, instance) {
- var min,
- o = instance.options,
- group = $.makeArray($(o.stack)).sort(function (a, b) {
- return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
- });
-
- if (!group.length) {
- return;
- }
-
- min = parseInt($(group[0]).css("zIndex"), 10) || 0;
- $(group).each(function (i) {
- $(this).css("zIndex", min + i);
- });
- this.css("zIndex", min + group.length);
- }
- });
- $.ui.plugin.add("draggable", "zIndex", {
- start: function start(event, ui, instance) {
- var t = $(ui.helper),
- o = instance.options;
-
- if (t.css("zIndex")) {
- o._zIndex = t.css("zIndex");
- }
-
- t.css("zIndex", o.zIndex);
- },
- stop: function stop(event, ui, instance) {
- var o = instance.options;
-
- if (o._zIndex) {
- $(ui.helper).css("zIndex", o._zIndex);
- }
- }
- });
- return $.ui.draggable;
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ui/ui/widgets/mouse.js":
-/*!****************************************************!*\
- !*** ./node_modules/jquery-ui/ui/widgets/mouse.js ***!
- \****************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery UI Mouse 1.13.1
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-//>>label: Mouse
-//>>group: Widgets
-//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
-//>>docs: http://api.jqueryui.com/mouse/
-(function (factory) {
- "use strict";
-
- if (true) {
- // AMD. Register as an anonymous module.
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! ../ie */ "./node_modules/jquery-ui/ui/ie.js"), __webpack_require__(/*! ../version */ "./node_modules/jquery-ui/ui/version.js"), __webpack_require__(/*! ../widget */ "./node_modules/jquery-ui/ui/widget.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-})(function ($) {
- "use strict";
-
- var mouseHandled = false;
- $(document).on("mouseup", function () {
- mouseHandled = false;
- });
- return $.widget("ui.mouse", {
- version: "1.13.1",
- options: {
- cancel: "input, textarea, button, select, option",
- distance: 1,
- delay: 0
- },
- _mouseInit: function _mouseInit() {
- var that = this;
- this.element.on("mousedown." + this.widgetName, function (event) {
- return that._mouseDown(event);
- }).on("click." + this.widgetName, function (event) {
- if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
- $.removeData(event.target, that.widgetName + ".preventClickEvent");
- event.stopImmediatePropagation();
- return false;
- }
- });
- this.started = false;
- },
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function _mouseDestroy() {
- this.element.off("." + this.widgetName);
-
- if (this._mouseMoveDelegate) {
- this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate);
- }
- },
- _mouseDown: function _mouseDown(event) {
- // don't let more than one widget handle mouseStart
- if (mouseHandled) {
- return;
- }
-
- this._mouseMoved = false; // We may have missed mouseup (out of window)
-
- if (this._mouseStarted) {
- this._mouseUp(event);
- }
-
- this._mouseDownEvent = event;
- var that = this,
- btnIsLeft = event.which === 1,
- // event.target.nodeName works around a bug in IE 8 with
- // disabled inputs (#7620)
- elIsCancel = typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false;
-
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
-
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function () {
- that.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = this._mouseStart(event) !== false;
-
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- } // Click event may never have fired (Gecko & Opera)
-
-
- if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
- $.removeData(event.target, this.widgetName + ".preventClickEvent");
- } // These delegates are required to keep context
-
-
- this._mouseMoveDelegate = function (event) {
- return that._mouseMove(event);
- };
-
- this._mouseUpDelegate = function (event) {
- return that._mouseUp(event);
- };
-
- this.document.on("mousemove." + this.widgetName, this._mouseMoveDelegate).on("mouseup." + this.widgetName, this._mouseUpDelegate);
- event.preventDefault();
- mouseHandled = true;
- return true;
- },
- _mouseMove: function _mouseMove(event) {
- // Only check for mouseups outside the document if you've moved inside the document
- // at least once. This prevents the firing of mouseup in the case of IE<9, which will
- // fire a mousemove event if content is placed under the cursor. See #7778
- // Support: IE <9
- if (this._mouseMoved) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) {
- return this._mouseUp(event); // Iframe mouseup check - mouseup occurred in another document
- } else if (!event.which) {
- // Support: Safari <=8 - 9
- // Safari sets which to 0 if you press any of the following keys
- // during a drag (#14461)
- if (event.originalEvent.altKey || event.originalEvent.ctrlKey || event.originalEvent.metaKey || event.originalEvent.shiftKey) {
- this.ignoreMissingWhich = true;
- } else if (!this.ignoreMissingWhich) {
- return this._mouseUp(event);
- }
- }
- }
-
- if (event.which || event.button) {
- this._mouseMoved = true;
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
-
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = this._mouseStart(this._mouseDownEvent, event) !== false;
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- } else {
- this._mouseUp(event);
- }
- }
-
- return !this._mouseStarted;
- },
- _mouseUp: function _mouseUp(event) {
- this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
-
- if (event.target === this._mouseDownEvent.target) {
- $.data(event.target, this.widgetName + ".preventClickEvent", true);
- }
-
- this._mouseStop(event);
- }
-
- if (this._mouseDelayTimer) {
- clearTimeout(this._mouseDelayTimer);
- delete this._mouseDelayTimer;
- }
-
- this.ignoreMissingWhich = false;
- mouseHandled = false;
- event.preventDefault();
- },
- _mouseDistanceMet: function _mouseDistanceMet(event) {
- return Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance;
- },
- _mouseDelayMet: function
- /* event */
- _mouseDelayMet() {
- return this.mouseDelayMet;
- },
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function
- /* event */
- _mouseStart() {},
- _mouseDrag: function
- /* event */
- _mouseDrag() {},
- _mouseStop: function
- /* event */
- _mouseStop() {},
- _mouseCapture: function
- /* event */
- _mouseCapture() {
- return true;
- }
- });
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ui/ui/widgets/resizable.js":
-/*!********************************************************!*\
- !*** ./node_modules/jquery-ui/ui/widgets/resizable.js ***!
- \********************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery UI Resizable 1.13.1
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-//>>label: Resizable
-//>>group: Interactions
-//>>description: Enables resize functionality for any element.
-//>>docs: http://api.jqueryui.com/resizable/
-//>>demos: http://jqueryui.com/resizable/
-//>>css.structure: ../../themes/base/core.css
-//>>css.structure: ../../themes/base/resizable.css
-//>>css.theme: ../../themes/base/theme.css
-(function (factory) {
- "use strict";
-
- if (true) {
- // AMD. Register as an anonymous module.
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! ./mouse */ "./node_modules/jquery-ui/ui/widgets/mouse.js"), __webpack_require__(/*! ../disable-selection */ "./node_modules/jquery-ui/ui/disable-selection.js"), __webpack_require__(/*! ../plugin */ "./node_modules/jquery-ui/ui/plugin.js"), __webpack_require__(/*! ../version */ "./node_modules/jquery-ui/ui/version.js"), __webpack_require__(/*! ../widget */ "./node_modules/jquery-ui/ui/widget.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-})(function ($) {
- "use strict";
-
- $.widget("ui.resizable", $.ui.mouse, {
- version: "1.13.1",
- widgetEventPrefix: "resize",
- options: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- classes: {
- "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
- },
- containment: false,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- // See #7960
- zIndex: 90,
- // Callbacks
- resize: null,
- start: null,
- stop: null
- },
- _num: function _num(value) {
- return parseFloat(value) || 0;
- },
- _isNumber: function _isNumber(value) {
- return !isNaN(parseFloat(value));
- },
- _hasScroll: function _hasScroll(el, a) {
- if ($(el).css("overflow") === "hidden") {
- return false;
- }
-
- var scroll = a && a === "left" ? "scrollLeft" : "scrollTop",
- has = false;
-
- if (el[scroll] > 0) {
- return true;
- } // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
-
-
- try {
- el[scroll] = 1;
- has = el[scroll] > 0;
- el[scroll] = 0;
- } catch (e) {// `el` might be a string, then setting `scroll` will throw
- // an error in strict mode; ignore it.
- }
-
- return has;
- },
- _create: function _create() {
- var margins,
- o = this.options,
- that = this;
-
- this._addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!o.aspectRatio,
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
- }); // Wrap the element if it cannot hold child nodes
-
- if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
- this.element.wrap($("
").css({
- overflow: "hidden",
- position: this.element.css("position"),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css("top"),
- left: this.element.css("left")
- }));
- this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance"));
- this.elementIsWrapper = true;
- margins = {
- marginTop: this.originalElement.css("marginTop"),
- marginRight: this.originalElement.css("marginRight"),
- marginBottom: this.originalElement.css("marginBottom"),
- marginLeft: this.originalElement.css("marginLeft")
- };
- this.element.css(margins);
- this.originalElement.css("margin", 0); // support: Safari
- // Prevent Safari textarea resize
-
- this.originalResizeStyle = this.originalElement.css("resize");
- this.originalElement.css("resize", "none");
-
- this._proportionallyResizeElements.push(this.originalElement.css({
- position: "static",
- zoom: 1,
- display: "block"
- })); // Support: IE9
- // avoid IE jump (hard set the margin)
-
-
- this.originalElement.css(margins);
-
- this._proportionallyResize();
- }
-
- this._setupHandles();
-
- if (o.autoHide) {
- $(this.element).on("mouseenter", function () {
- if (o.disabled) {
- return;
- }
-
- that._removeClass("ui-resizable-autohide");
-
- that._handles.show();
- }).on("mouseleave", function () {
- if (o.disabled) {
- return;
- }
-
- if (!that.resizing) {
- that._addClass("ui-resizable-autohide");
-
- that._handles.hide();
- }
- });
- }
-
- this._mouseInit();
- },
- _destroy: function _destroy() {
- this._mouseDestroy();
-
- this._addedHandles.remove();
-
- var wrapper,
- _destroy = function _destroy(exp) {
- $(exp).removeData("resizable").removeData("ui-resizable").off(".resizable");
- }; // TODO: Unwrap at same DOM position
-
-
- if (this.elementIsWrapper) {
- _destroy(this.element);
-
- wrapper = this.element;
- this.originalElement.css({
- position: wrapper.css("position"),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css("top"),
- left: wrapper.css("left")
- }).insertAfter(wrapper);
- wrapper.remove();
- }
-
- this.originalElement.css("resize", this.originalResizeStyle);
-
- _destroy(this.originalElement);
-
- return this;
- },
- _setOption: function _setOption(key, value) {
- this._super(key, value);
-
- switch (key) {
- case "handles":
- this._removeHandles();
-
- this._setupHandles();
-
- break;
-
- case "aspectRatio":
- this._aspectRatio = !!value;
- break;
-
- default:
- break;
- }
- },
- _setupHandles: function _setupHandles() {
- var o = this.options,
- handle,
- i,
- n,
- hname,
- axis,
- that = this;
- this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : {
- n: ".ui-resizable-n",
- e: ".ui-resizable-e",
- s: ".ui-resizable-s",
- w: ".ui-resizable-w",
- se: ".ui-resizable-se",
- sw: ".ui-resizable-sw",
- ne: ".ui-resizable-ne",
- nw: ".ui-resizable-nw"
- });
- this._handles = $();
- this._addedHandles = $();
-
- if (this.handles.constructor === String) {
- if (this.handles === "all") {
- this.handles = "n,e,s,w,se,sw,ne,nw";
- }
-
- n = this.handles.split(",");
- this.handles = {};
-
- for (i = 0; i < n.length; i++) {
- handle = String.prototype.trim.call(n[i]);
- hname = "ui-resizable-" + handle;
- axis = $("
");
-
- this._addClass(axis, "ui-resizable-handle " + hname);
-
- axis.css({
- zIndex: o.zIndex
- });
- this.handles[handle] = ".ui-resizable-" + handle;
-
- if (!this.element.children(this.handles[handle]).length) {
- this.element.append(axis);
- this._addedHandles = this._addedHandles.add(axis);
- }
- }
- }
-
- this._renderAxis = function (target) {
- var i, axis, padPos, padWrapper;
- target = target || this.element;
-
- for (i in this.handles) {
- if (this.handles[i].constructor === String) {
- this.handles[i] = this.element.children(this.handles[i]).first().show();
- } else if (this.handles[i].jquery || this.handles[i].nodeType) {
- this.handles[i] = $(this.handles[i]);
-
- this._on(this.handles[i], {
- "mousedown": that._mouseDown
- });
- }
-
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
- axis = $(this.handles[i], this.element);
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
- padPos = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join("");
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
- }
-
- this._handles = this._handles.add(this.handles[i]);
- }
- }; // TODO: make renderAxis a prototype function
-
-
- this._renderAxis(this.element);
-
- this._handles = this._handles.add(this.element.find(".ui-resizable-handle"));
-
- this._handles.disableSelection();
-
- this._handles.on("mouseover", function () {
- if (!that.resizing) {
- if (this.className) {
- axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- }
-
- that.axis = axis && axis[1] ? axis[1] : "se";
- }
- });
-
- if (o.autoHide) {
- this._handles.hide();
-
- this._addClass("ui-resizable-autohide");
- }
- },
- _removeHandles: function _removeHandles() {
- this._addedHandles.remove();
- },
- _mouseCapture: function _mouseCapture(event) {
- var i,
- handle,
- capture = false;
-
- for (i in this.handles) {
- handle = $(this.handles[i])[0];
-
- if (handle === event.target || $.contains(handle, event.target)) {
- capture = true;
- }
- }
-
- return !this.options.disabled && capture;
- },
- _mouseStart: function _mouseStart(event) {
- var curleft,
- curtop,
- cursor,
- o = this.options,
- el = this.element;
- this.resizing = true;
-
- this._renderProxy();
-
- curleft = this._num(this.helper.css("left"));
- curtop = this._num(this.helper.css("top"));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- this.offset = this.helper.offset();
- this.position = {
- left: curleft,
- top: curtop
- };
- this.size = this._helper ? {
- width: this.helper.width(),
- height: this.helper.height()
- } : {
- width: el.width(),
- height: el.height()
- };
- this.originalSize = this._helper ? {
- width: el.outerWidth(),
- height: el.outerHeight()
- } : {
- width: el.width(),
- height: el.height()
- };
- this.sizeDiff = {
- width: el.outerWidth() - el.width(),
- height: el.outerHeight() - el.height()
- };
- this.originalPosition = {
- left: curleft,
- top: curtop
- };
- this.originalMousePosition = {
- left: event.pageX,
- top: event.pageY
- };
- this.aspectRatio = typeof o.aspectRatio === "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1;
- cursor = $(".ui-resizable-" + this.axis).css("cursor");
- $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
-
- this._addClass("ui-resizable-resizing");
-
- this._propagate("start", event);
-
- return true;
- },
- _mouseDrag: function _mouseDrag(event) {
- var data,
- props,
- smp = this.originalMousePosition,
- a = this.axis,
- dx = event.pageX - smp.left || 0,
- dy = event.pageY - smp.top || 0,
- trigger = this._change[a];
-
- this._updatePrevProperties();
-
- if (!trigger) {
- return false;
- }
-
- data = trigger.apply(this, [event, dx, dy]);
-
- this._updateVirtualBoundaries(event.shiftKey);
-
- if (this._aspectRatio || event.shiftKey) {
- data = this._updateRatio(data, event);
- }
-
- data = this._respectSize(data, event);
-
- this._updateCache(data);
-
- this._propagate("resize", event);
-
- props = this._applyChanges();
-
- if (!this._helper && this._proportionallyResizeElements.length) {
- this._proportionallyResize();
- }
-
- if (!$.isEmptyObject(props)) {
- this._updatePrevProperties();
-
- this._trigger("resize", event, this.ui());
-
- this._applyChanges();
- }
-
- return false;
- },
- _mouseStop: function _mouseStop(event) {
- this.resizing = false;
- var pr,
- ista,
- soffseth,
- soffsetw,
- s,
- left,
- top,
- o = this.options,
- that = this;
-
- if (this._helper) {
- pr = this._proportionallyResizeElements;
- ista = pr.length && /textarea/i.test(pr[0].nodeName);
- soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
- soffsetw = ista ? 0 : that.sizeDiff.width;
- s = {
- width: that.helper.width() - soffsetw,
- height: that.helper.height() - soffseth
- };
- left = parseFloat(that.element.css("left")) + (that.position.left - that.originalPosition.left) || null;
- top = parseFloat(that.element.css("top")) + (that.position.top - that.originalPosition.top) || null;
-
- if (!o.animate) {
- this.element.css($.extend(s, {
- top: top,
- left: left
- }));
- }
-
- that.helper.height(that.size.height);
- that.helper.width(that.size.width);
-
- if (this._helper && !o.animate) {
- this._proportionallyResize();
- }
- }
-
- $("body").css("cursor", "auto");
-
- this._removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) {
- this.helper.remove();
- }
-
- return false;
- },
- _updatePrevProperties: function _updatePrevProperties() {
- this.prevPosition = {
- top: this.position.top,
- left: this.position.left
- };
- this.prevSize = {
- width: this.size.width,
- height: this.size.height
- };
- },
- _applyChanges: function _applyChanges() {
- var props = {};
-
- if (this.position.top !== this.prevPosition.top) {
- props.top = this.position.top + "px";
- }
-
- if (this.position.left !== this.prevPosition.left) {
- props.left = this.position.left + "px";
- }
-
- if (this.size.width !== this.prevSize.width) {
- props.width = this.size.width + "px";
- }
-
- if (this.size.height !== this.prevSize.height) {
- props.height = this.size.height + "px";
- }
-
- this.helper.css(props);
- return props;
- },
- _updateVirtualBoundaries: function _updateVirtualBoundaries(forceAspectRatio) {
- var pMinWidth,
- pMaxWidth,
- pMinHeight,
- pMaxHeight,
- b,
- o = this.options;
- b = {
- minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
- maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
- minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
- maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
- };
-
- if (this._aspectRatio || forceAspectRatio) {
- pMinWidth = b.minHeight * this.aspectRatio;
- pMinHeight = b.minWidth / this.aspectRatio;
- pMaxWidth = b.maxHeight * this.aspectRatio;
- pMaxHeight = b.maxWidth / this.aspectRatio;
-
- if (pMinWidth > b.minWidth) {
- b.minWidth = pMinWidth;
- }
-
- if (pMinHeight > b.minHeight) {
- b.minHeight = pMinHeight;
- }
-
- if (pMaxWidth < b.maxWidth) {
- b.maxWidth = pMaxWidth;
- }
-
- if (pMaxHeight < b.maxHeight) {
- b.maxHeight = pMaxHeight;
- }
- }
-
- this._vBoundaries = b;
- },
- _updateCache: function _updateCache(data) {
- this.offset = this.helper.offset();
-
- if (this._isNumber(data.left)) {
- this.position.left = data.left;
- }
-
- if (this._isNumber(data.top)) {
- this.position.top = data.top;
- }
-
- if (this._isNumber(data.height)) {
- this.size.height = data.height;
- }
-
- if (this._isNumber(data.width)) {
- this.size.width = data.width;
- }
- },
- _updateRatio: function _updateRatio(data) {
- var cpos = this.position,
- csize = this.size,
- a = this.axis;
-
- if (this._isNumber(data.height)) {
- data.width = data.height * this.aspectRatio;
- } else if (this._isNumber(data.width)) {
- data.height = data.width / this.aspectRatio;
- }
-
- if (a === "sw") {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
-
- if (a === "nw") {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
- _respectSize: function _respectSize(data) {
- var o = this._vBoundaries,
- a = this.axis,
- ismaxw = this._isNumber(data.width) && o.maxWidth && o.maxWidth < data.width,
- ismaxh = this._isNumber(data.height) && o.maxHeight && o.maxHeight < data.height,
- isminw = this._isNumber(data.width) && o.minWidth && o.minWidth > data.width,
- isminh = this._isNumber(data.height) && o.minHeight && o.minHeight > data.height,
- dw = this.originalPosition.left + this.originalSize.width,
- dh = this.originalPosition.top + this.originalSize.height,
- cw = /sw|nw|w/.test(a),
- ch = /nw|ne|n/.test(a);
-
- if (isminw) {
- data.width = o.minWidth;
- }
-
- if (isminh) {
- data.height = o.minHeight;
- }
-
- if (ismaxw) {
- data.width = o.maxWidth;
- }
-
- if (ismaxh) {
- data.height = o.maxHeight;
- }
-
- if (isminw && cw) {
- data.left = dw - o.minWidth;
- }
-
- if (ismaxw && cw) {
- data.left = dw - o.maxWidth;
- }
-
- if (isminh && ch) {
- data.top = dh - o.minHeight;
- }
-
- if (ismaxh && ch) {
- data.top = dh - o.maxHeight;
- } // Fixing jump error on top/left - bug #2330
-
-
- if (!data.width && !data.height && !data.left && data.top) {
- data.top = null;
- } else if (!data.width && !data.height && !data.top && data.left) {
- data.left = null;
- }
-
- return data;
- },
- _getPaddingPlusBorderDimensions: function _getPaddingPlusBorderDimensions(element) {
- var i = 0,
- widths = [],
- borders = [element.css("borderTopWidth"), element.css("borderRightWidth"), element.css("borderBottomWidth"), element.css("borderLeftWidth")],
- paddings = [element.css("paddingTop"), element.css("paddingRight"), element.css("paddingBottom"), element.css("paddingLeft")];
-
- for (; i < 4; i++) {
- widths[i] = parseFloat(borders[i]) || 0;
- widths[i] += parseFloat(paddings[i]) || 0;
- }
-
- return {
- height: widths[0] + widths[2],
- width: widths[1] + widths[3]
- };
- },
- _proportionallyResize: function _proportionallyResize() {
- if (!this._proportionallyResizeElements.length) {
- return;
- }
-
- var prel,
- i = 0,
- element = this.helper || this.element;
-
- for (; i < this._proportionallyResizeElements.length; i++) {
- prel = this._proportionallyResizeElements[i]; // TODO: Seems like a bug to cache this.outerDimensions
- // considering that we are in a loop.
-
- if (!this.outerDimensions) {
- this.outerDimensions = this._getPaddingPlusBorderDimensions(prel);
- }
-
- prel.css({
- height: element.height() - this.outerDimensions.height || 0,
- width: element.width() - this.outerDimensions.width || 0
- });
- }
- },
- _renderProxy: function _renderProxy() {
- var el = this.element,
- o = this.options;
- this.elementOffset = el.offset();
-
- if (this._helper) {
- this.helper = this.helper || $("
").css({
- overflow: "hidden"
- });
-
- this._addClass(this.helper, this._helper);
-
- this.helper.css({
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- position: "absolute",
- left: this.elementOffset.left + "px",
- top: this.elementOffset.top + "px",
- zIndex: ++o.zIndex //TODO: Don't modify option
-
- });
- this.helper.appendTo("body").disableSelection();
- } else {
- this.helper = this.element;
- }
- },
- _change: {
- e: function e(event, dx) {
- return {
- width: this.originalSize.width + dx
- };
- },
- w: function w(event, dx) {
- var cs = this.originalSize,
- sp = this.originalPosition;
- return {
- left: sp.left + dx,
- width: cs.width - dx
- };
- },
- n: function n(event, dx, dy) {
- var cs = this.originalSize,
- sp = this.originalPosition;
- return {
- top: sp.top + dy,
- height: cs.height - dy
- };
- },
- s: function s(event, dx, dy) {
- return {
- height: this.originalSize.height + dy
- };
- },
- se: function se(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function sw(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function ne(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function nw(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
- _propagate: function _propagate(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
-
- if (n !== "resize") {
- this._trigger(n, event, this.ui());
- }
- },
- plugins: {},
- ui: function ui() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
- });
- /*
- * Resizable Extensions
- */
-
- $.ui.plugin.add("resizable", "animate", {
- stop: function stop(event) {
- var that = $(this).resizable("instance"),
- o = that.options,
- pr = that._proportionallyResizeElements,
- ista = pr.length && /textarea/i.test(pr[0].nodeName),
- soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
- soffsetw = ista ? 0 : that.sizeDiff.width,
- style = {
- width: that.size.width - soffsetw,
- height: that.size.height - soffseth
- },
- left = parseFloat(that.element.css("left")) + (that.position.left - that.originalPosition.left) || null,
- top = parseFloat(that.element.css("top")) + (that.position.top - that.originalPosition.top) || null;
- that.element.animate($.extend(style, top && left ? {
- top: top,
- left: left
- } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function step() {
- var data = {
- width: parseFloat(that.element.css("width")),
- height: parseFloat(that.element.css("height")),
- top: parseFloat(that.element.css("top")),
- left: parseFloat(that.element.css("left"))
- };
-
- if (pr && pr.length) {
- $(pr[0]).css({
- width: data.width,
- height: data.height
- });
- } // Propagating resize, and updating values for each animation step
-
-
- that._updateCache(data);
-
- that._propagate("resize", event);
- }
- });
- }
- });
- $.ui.plugin.add("resizable", "containment", {
- start: function start() {
- var element,
- p,
- co,
- ch,
- cw,
- width,
- height,
- that = $(this).resizable("instance"),
- o = that.options,
- el = that.element,
- oc = o.containment,
- ce = oc instanceof $ ? oc.get(0) : /parent/.test(oc) ? el.parent().get(0) : oc;
-
- if (!ce) {
- return;
- }
-
- that.containerElement = $(ce);
-
- if (/document/.test(oc) || oc === document) {
- that.containerOffset = {
- left: 0,
- top: 0
- };
- that.containerPosition = {
- left: 0,
- top: 0
- };
- that.parentData = {
- element: $(document),
- left: 0,
- top: 0,
- width: $(document).width(),
- height: $(document).height() || document.body.parentNode.scrollHeight
- };
- } else {
- element = $(ce);
- p = [];
- $(["Top", "Right", "Left", "Bottom"]).each(function (i, name) {
- p[i] = that._num(element.css("padding" + name));
- });
- that.containerOffset = element.offset();
- that.containerPosition = element.position();
- that.containerSize = {
- height: element.innerHeight() - p[3],
- width: element.innerWidth() - p[1]
- };
- co = that.containerOffset;
- ch = that.containerSize.height;
- cw = that.containerSize.width;
- width = that._hasScroll(ce, "left") ? ce.scrollWidth : cw;
- height = that._hasScroll(ce) ? ce.scrollHeight : ch;
- that.parentData = {
- element: ce,
- left: co.left,
- top: co.top,
- width: width,
- height: height
- };
- }
- },
- resize: function resize(event) {
- var woset,
- hoset,
- isParent,
- isOffsetRelative,
- that = $(this).resizable("instance"),
- o = that.options,
- co = that.containerOffset,
- cp = that.position,
- pRatio = that._aspectRatio || event.shiftKey,
- cop = {
- top: 0,
- left: 0
- },
- ce = that.containerElement,
- continueResize = true;
-
- if (ce[0] !== document && /static/.test(ce.css("position"))) {
- cop = co;
- }
-
- if (cp.left < (that._helper ? co.left : 0)) {
- that.size.width = that.size.width + (that._helper ? that.position.left - co.left : that.position.left - cop.left);
-
- if (pRatio) {
- that.size.height = that.size.width / that.aspectRatio;
- continueResize = false;
- }
-
- that.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (that._helper ? co.top : 0)) {
- that.size.height = that.size.height + (that._helper ? that.position.top - co.top : that.position.top);
-
- if (pRatio) {
- that.size.width = that.size.height * that.aspectRatio;
- continueResize = false;
- }
-
- that.position.top = that._helper ? co.top : 0;
- }
-
- isParent = that.containerElement.get(0) === that.element.parent().get(0);
- isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
-
- if (isParent && isOffsetRelative) {
- that.offset.left = that.parentData.left + that.position.left;
- that.offset.top = that.parentData.top + that.position.top;
- } else {
- that.offset.left = that.element.offset().left;
- that.offset.top = that.element.offset().top;
- }
-
- woset = Math.abs(that.sizeDiff.width + (that._helper ? that.offset.left - cop.left : that.offset.left - co.left));
- hoset = Math.abs(that.sizeDiff.height + (that._helper ? that.offset.top - cop.top : that.offset.top - co.top));
-
- if (woset + that.size.width >= that.parentData.width) {
- that.size.width = that.parentData.width - woset;
-
- if (pRatio) {
- that.size.height = that.size.width / that.aspectRatio;
- continueResize = false;
- }
- }
-
- if (hoset + that.size.height >= that.parentData.height) {
- that.size.height = that.parentData.height - hoset;
-
- if (pRatio) {
- that.size.width = that.size.height * that.aspectRatio;
- continueResize = false;
- }
- }
-
- if (!continueResize) {
- that.position.left = that.prevPosition.left;
- that.position.top = that.prevPosition.top;
- that.size.width = that.prevSize.width;
- that.size.height = that.prevSize.height;
- }
- },
- stop: function stop() {
- var that = $(this).resizable("instance"),
- o = that.options,
- co = that.containerOffset,
- cop = that.containerPosition,
- ce = that.containerElement,
- helper = $(that.helper),
- ho = helper.offset(),
- w = helper.outerWidth() - that.sizeDiff.width,
- h = helper.outerHeight() - that.sizeDiff.height;
-
- if (that._helper && !o.animate && /relative/.test(ce.css("position"))) {
- $(this).css({
- left: ho.left - cop.left - co.left,
- width: w,
- height: h
- });
- }
-
- if (that._helper && !o.animate && /static/.test(ce.css("position"))) {
- $(this).css({
- left: ho.left - cop.left - co.left,
- width: w,
- height: h
- });
- }
- }
- });
- $.ui.plugin.add("resizable", "alsoResize", {
- start: function start() {
- var that = $(this).resizable("instance"),
- o = that.options;
- $(o.alsoResize).each(function () {
- var el = $(this);
- el.data("ui-resizable-alsoresize", {
- width: parseFloat(el.width()),
- height: parseFloat(el.height()),
- left: parseFloat(el.css("left")),
- top: parseFloat(el.css("top"))
- });
- });
- },
- resize: function resize(event, ui) {
- var that = $(this).resizable("instance"),
- o = that.options,
- os = that.originalSize,
- op = that.originalPosition,
- delta = {
- height: that.size.height - os.height || 0,
- width: that.size.width - os.width || 0,
- top: that.position.top - op.top || 0,
- left: that.position.left - op.left || 0
- };
- $(o.alsoResize).each(function () {
- var el = $(this),
- start = $(this).data("ui-resizable-alsoresize"),
- style = {},
- css = el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
- $.each(css, function (i, prop) {
- var sum = (start[prop] || 0) + (delta[prop] || 0);
-
- if (sum && sum >= 0) {
- style[prop] = sum || null;
- }
- });
- el.css(style);
- });
- },
- stop: function stop() {
- $(this).removeData("ui-resizable-alsoresize");
- }
- });
- $.ui.plugin.add("resizable", "ghost", {
- start: function start() {
- var that = $(this).resizable("instance"),
- cs = that.size;
- that.ghost = that.originalElement.clone();
- that.ghost.css({
- opacity: 0.25,
- display: "block",
- position: "relative",
- height: cs.height,
- width: cs.width,
- margin: 0,
- left: 0,
- top: 0
- });
-
- that._addClass(that.ghost, "ui-resizable-ghost"); // DEPRECATED
- // TODO: remove after 1.12
-
-
- if ($.uiBackCompat !== false && typeof that.options.ghost === "string") {
- // Ghost option
- that.ghost.addClass(this.options.ghost);
- }
-
- that.ghost.appendTo(that.helper);
- },
- resize: function resize() {
- var that = $(this).resizable("instance");
-
- if (that.ghost) {
- that.ghost.css({
- position: "relative",
- height: that.size.height,
- width: that.size.width
- });
- }
- },
- stop: function stop() {
- var that = $(this).resizable("instance");
-
- if (that.ghost && that.helper) {
- that.helper.get(0).removeChild(that.ghost.get(0));
- }
- }
- });
- $.ui.plugin.add("resizable", "grid", {
- resize: function resize() {
- var outerDimensions,
- that = $(this).resizable("instance"),
- o = that.options,
- cs = that.size,
- os = that.originalSize,
- op = that.originalPosition,
- a = that.axis,
- grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
- gridX = grid[0] || 1,
- gridY = grid[1] || 1,
- ox = Math.round((cs.width - os.width) / gridX) * gridX,
- oy = Math.round((cs.height - os.height) / gridY) * gridY,
- newWidth = os.width + ox,
- newHeight = os.height + oy,
- isMaxWidth = o.maxWidth && o.maxWidth < newWidth,
- isMaxHeight = o.maxHeight && o.maxHeight < newHeight,
- isMinWidth = o.minWidth && o.minWidth > newWidth,
- isMinHeight = o.minHeight && o.minHeight > newHeight;
- o.grid = grid;
-
- if (isMinWidth) {
- newWidth += gridX;
- }
-
- if (isMinHeight) {
- newHeight += gridY;
- }
-
- if (isMaxWidth) {
- newWidth -= gridX;
- }
-
- if (isMaxHeight) {
- newHeight -= gridY;
- }
-
- if (/^(se|s|e)$/.test(a)) {
- that.size.width = newWidth;
- that.size.height = newHeight;
- } else if (/^(ne)$/.test(a)) {
- that.size.width = newWidth;
- that.size.height = newHeight;
- that.position.top = op.top - oy;
- } else if (/^(sw)$/.test(a)) {
- that.size.width = newWidth;
- that.size.height = newHeight;
- that.position.left = op.left - ox;
- } else {
- if (newHeight - gridY <= 0 || newWidth - gridX <= 0) {
- outerDimensions = that._getPaddingPlusBorderDimensions(this);
- }
-
- if (newHeight - gridY > 0) {
- that.size.height = newHeight;
- that.position.top = op.top - oy;
- } else {
- newHeight = gridY - outerDimensions.height;
- that.size.height = newHeight;
- that.position.top = op.top + os.height - newHeight;
- }
-
- if (newWidth - gridX > 0) {
- that.size.width = newWidth;
- that.position.left = op.left - ox;
- } else {
- newWidth = gridX - outerDimensions.width;
- that.size.width = newWidth;
- that.position.left = op.left + os.width - newWidth;
- }
- }
- }
- });
- return $.ui.resizable;
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ui/ui/widgets/sortable.js":
-/*!*******************************************************!*\
- !*** ./node_modules/jquery-ui/ui/widgets/sortable.js ***!
- \*******************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery UI Sortable 1.13.1
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-//>>label: Sortable
-//>>group: Interactions
-//>>description: Enables items in a list to be sorted using the mouse.
-//>>docs: http://api.jqueryui.com/sortable/
-//>>demos: http://jqueryui.com/sortable/
-//>>css.structure: ../../themes/base/sortable.css
-(function (factory) {
- "use strict";
-
- if (true) {
- // AMD. Register as an anonymous module.
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! ./mouse */ "./node_modules/jquery-ui/ui/widgets/mouse.js"), __webpack_require__(/*! ../data */ "./node_modules/jquery-ui/ui/data.js"), __webpack_require__(/*! ../ie */ "./node_modules/jquery-ui/ui/ie.js"), __webpack_require__(/*! ../scroll-parent */ "./node_modules/jquery-ui/ui/scroll-parent.js"), __webpack_require__(/*! ../version */ "./node_modules/jquery-ui/ui/version.js"), __webpack_require__(/*! ../widget */ "./node_modules/jquery-ui/ui/widget.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-})(function ($) {
- "use strict";
-
- return $.widget("ui.sortable", $.ui.mouse, {
- version: "1.13.1",
- widgetEventPrefix: "sort",
- ready: false,
- options: {
- appendTo: "parent",
- axis: false,
- connectWith: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- dropOnEmpty: true,
- forcePlaceholderSize: false,
- forceHelperSize: false,
- grid: false,
- handle: false,
- helper: "original",
- items: "> *",
- opacity: false,
- placeholder: false,
- revert: false,
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- scope: "default",
- tolerance: "intersect",
- zIndex: 1000,
- // Callbacks
- activate: null,
- beforeStop: null,
- change: null,
- deactivate: null,
- out: null,
- over: null,
- receive: null,
- remove: null,
- sort: null,
- start: null,
- stop: null,
- update: null
- },
- _isOverAxis: function _isOverAxis(x, reference, size) {
- return x >= reference && x < reference + size;
- },
- _isFloating: function _isFloating(item) {
- return /left|right/.test(item.css("float")) || /inline|table-cell/.test(item.css("display"));
- },
- _create: function _create() {
- this.containerCache = {};
-
- this._addClass("ui-sortable"); //Get the items
-
-
- this.refresh(); //Let's determine the parent's offset
-
- this.offset = this.element.offset(); //Initialize mouse events for interaction
-
- this._mouseInit();
-
- this._setHandleClassName(); //We're ready to go
-
-
- this.ready = true;
- },
- _setOption: function _setOption(key, value) {
- this._super(key, value);
-
- if (key === "handle") {
- this._setHandleClassName();
- }
- },
- _setHandleClassName: function _setHandleClassName() {
- var that = this;
-
- this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle");
-
- $.each(this.items, function () {
- that._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, "ui-sortable-handle");
- });
- },
- _destroy: function _destroy() {
- this._mouseDestroy();
-
- for (var i = this.items.length - 1; i >= 0; i--) {
- this.items[i].item.removeData(this.widgetName + "-item");
- }
-
- return this;
- },
- _mouseCapture: function _mouseCapture(event, overrideHandle) {
- var currentItem = null,
- validHandle = false,
- that = this;
-
- if (this.reverting) {
- return false;
- }
-
- if (this.options.disabled || this.options.type === "static") {
- return false;
- } //We have to refresh the items data once first
-
-
- this._refreshItems(event); //Find out if the clicked node (or one of its parents) is a actual item in this.items
-
-
- $(event.target).parents().each(function () {
- if ($.data(this, that.widgetName + "-item") === that) {
- currentItem = $(this);
- return false;
- }
- });
-
- if ($.data(event.target, that.widgetName + "-item") === that) {
- currentItem = $(event.target);
- }
-
- if (!currentItem) {
- return false;
- }
-
- if (this.options.handle && !overrideHandle) {
- $(this.options.handle, currentItem).find("*").addBack().each(function () {
- if (this === event.target) {
- validHandle = true;
- }
- });
-
- if (!validHandle) {
- return false;
- }
- }
-
- this.currentItem = currentItem;
-
- this._removeCurrentsFromItems();
-
- return true;
- },
- _mouseStart: function _mouseStart(event, overrideHandle, noActivation) {
- var i,
- body,
- o = this.options;
- this.currentContainer = this; //We only need to call refreshPositions, because the refreshItems call has been moved to
- // mouseCapture
-
- this.refreshPositions(); //Prepare the dragged items parent
-
- this.appendTo = $(o.appendTo !== "parent" ? o.appendTo : this.currentItem.parent()); //Create and append the visible helper
-
- this.helper = this._createHelper(event); //Cache the helper size
-
- this._cacheHelperProportions();
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
- //Cache the margins of the original element
-
-
- this._cacheMargins(); //The element's absolute position on the page minus margins
-
-
- this.offset = this.currentItem.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
- $.extend(this.offset, {
- click: {
- //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- // This is a relative to absolute position minus the actual position calculation -
- // only used for relative positioned helper
- relative: this._getRelativeOffset()
- }); // After we get the helper offset, but before we get the parent offset we can
- // change the helper's position to absolute
- // TODO: Still need to figure out a way to make relative sorting possible
-
- this.helper.css("position", "absolute");
- this.cssPosition = this.helper.css("position"); //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
-
- if (o.cursorAt) {
- this._adjustOffsetFromHelper(o.cursorAt);
- } //Cache the former DOM position
-
-
- this.domPosition = {
- prev: this.currentItem.prev()[0],
- parent: this.currentItem.parent()[0]
- }; // If the helper is not the original, hide the original so it's not playing any role during
- // the drag, won't cause anything bad this way
-
- if (this.helper[0] !== this.currentItem[0]) {
- this.currentItem.hide();
- } //Create the placeholder
-
-
- this._createPlaceholder(); //Get the next scrolling parent
-
-
- this.scrollParent = this.placeholder.scrollParent();
- $.extend(this.offset, {
- parent: this._getParentOffset()
- }); //Set a containment if given in the options
-
- if (o.containment) {
- this._setContainment();
- }
-
- if (o.cursor && o.cursor !== "auto") {
- // cursor option
- body = this.document.find("body"); // Support: IE
-
- this.storedCursor = body.css("cursor");
- body.css("cursor", o.cursor);
- this.storedStylesheet = $("").appendTo(body);
- } // We need to make sure to grab the zIndex before setting the
- // opacity, because setting the opacity to anything lower than 1
- // causes the zIndex to change from "auto" to 0.
-
-
- if (o.zIndex) {
- // zIndex option
- if (this.helper.css("zIndex")) {
- this._storedZIndex = this.helper.css("zIndex");
- }
-
- this.helper.css("zIndex", o.zIndex);
- }
-
- if (o.opacity) {
- // opacity option
- if (this.helper.css("opacity")) {
- this._storedOpacity = this.helper.css("opacity");
- }
-
- this.helper.css("opacity", o.opacity);
- } //Prepare scrolling
-
-
- if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
- this.overflowOffset = this.scrollParent.offset();
- } //Call callbacks
-
-
- this._trigger("start", event, this._uiHash()); //Recache the helper size
-
-
- if (!this._preserveHelperProportions) {
- this._cacheHelperProportions();
- } //Post "activate" events to possible containers
-
-
- if (!noActivation) {
- for (i = this.containers.length - 1; i >= 0; i--) {
- this.containers[i]._trigger("activate", event, this._uiHash(this));
- }
- } //Prepare possible droppables
-
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.current = this;
- }
-
- if ($.ui.ddmanager && !o.dropBehaviour) {
- $.ui.ddmanager.prepareOffsets(this, event);
- }
-
- this.dragging = true;
-
- this._addClass(this.helper, "ui-sortable-helper"); //Move the helper, if needed
-
-
- if (!this.helper.parent().is(this.appendTo)) {
- this.helper.detach().appendTo(this.appendTo); //Update position
-
- this.offset.parent = this._getParentOffset();
- } //Generate the original position
-
-
- this.position = this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
- this.lastPositionAbs = this.positionAbs = this._convertPositionTo("absolute");
-
- this._mouseDrag(event);
-
- return true;
- },
- _scroll: function _scroll(event) {
- var o = this.options,
- scrolled = false;
-
- if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
- if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) {
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
- } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) {
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
- } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
- } else {
- if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
- scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
- } else if (this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
- scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
- }
-
- if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
- scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
- } else if (this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
- scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
- }
- }
-
- return scrolled;
- },
- _mouseDrag: function _mouseDrag(event) {
- var i,
- item,
- itemElement,
- intersection,
- o = this.options; //Compute the helpers position
-
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute"); //Set the helper position
-
- if (!this.options.axis || this.options.axis !== "y") {
- this.helper[0].style.left = this.position.left + "px";
- }
-
- if (!this.options.axis || this.options.axis !== "x") {
- this.helper[0].style.top = this.position.top + "px";
- } //Do scrolling
-
-
- if (o.scroll) {
- if (this._scroll(event) !== false) {
- //Update item positions used in position checks
- this._refreshItemPositions(true);
-
- if ($.ui.ddmanager && !o.dropBehaviour) {
- $.ui.ddmanager.prepareOffsets(this, event);
- }
- }
- }
-
- this.dragDirection = {
- vertical: this._getDragVerticalDirection(),
- horizontal: this._getDragHorizontalDirection()
- }; //Rearrange
-
- for (i = this.items.length - 1; i >= 0; i--) {
- //Cache variables and intersection, continue if no intersection
- item = this.items[i];
- itemElement = item.item[0];
- intersection = this._intersectsWithPointer(item);
-
- if (!intersection) {
- continue;
- } // Only put the placeholder inside the current Container, skip all
- // items from other containers. This works because when moving
- // an item from one container to another the
- // currentContainer is switched before the placeholder is moved.
- //
- // Without this, moving items in "sub-sortables" can cause
- // the placeholder to jitter between the outer and inner container.
-
-
- if (item.instance !== this.currentContainer) {
- continue;
- } // Cannot intersect with itself
- // no useless actions that have been done before
- // no action if the item moved is the parent of the item checked
-
-
- if (itemElement !== this.currentItem[0] && this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) {
- this.direction = intersection === 1 ? "down" : "up";
-
- if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
- this._rearrange(event, item);
- } else {
- break;
- }
-
- this._trigger("change", event, this._uiHash());
-
- break;
- }
- } //Post events to containers
-
-
- this._contactContainers(event); //Interconnect with droppables
-
-
- if ($.ui.ddmanager) {
- $.ui.ddmanager.drag(this, event);
- } //Call callbacks
-
-
- this._trigger("sort", event, this._uiHash());
-
- this.lastPositionAbs = this.positionAbs;
- return false;
- },
- _mouseStop: function _mouseStop(event, noPropagation) {
- if (!event) {
- return;
- } //If we are using droppables, inform the manager about the drop
-
-
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
- $.ui.ddmanager.drop(this, event);
- }
-
- if (this.options.revert) {
- var that = this,
- cur = this.placeholder.offset(),
- axis = this.options.axis,
- animation = {};
-
- if (!axis || axis === "x") {
- animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
- }
-
- if (!axis || axis === "y") {
- animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
- }
-
- this.reverting = true;
- $(this.helper).animate(animation, parseInt(this.options.revert, 10) || 500, function () {
- that._clear(event);
- });
- } else {
- this._clear(event, noPropagation);
- }
-
- return false;
- },
- cancel: function cancel() {
- if (this.dragging) {
- this._mouseUp(new $.Event("mouseup", {
- target: null
- }));
-
- if (this.options.helper === "original") {
- this.currentItem.css(this._storedCSS);
-
- this._removeClass(this.currentItem, "ui-sortable-helper");
- } else {
- this.currentItem.show();
- } //Post deactivating events to containers
-
-
- for (var i = this.containers.length - 1; i >= 0; i--) {
- this.containers[i]._trigger("deactivate", null, this._uiHash(this));
-
- if (this.containers[i].containerCache.over) {
- this.containers[i]._trigger("out", null, this._uiHash(this));
-
- this.containers[i].containerCache.over = 0;
- }
- }
- }
-
- if (this.placeholder) {
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
- // it unbinds ALL events from the original node!
- if (this.placeholder[0].parentNode) {
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
- }
-
- if (this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
- this.helper.remove();
- }
-
- $.extend(this, {
- helper: null,
- dragging: false,
- reverting: false,
- _noFinalSort: null
- });
-
- if (this.domPosition.prev) {
- $(this.domPosition.prev).after(this.currentItem);
- } else {
- $(this.domPosition.parent).prepend(this.currentItem);
- }
- }
-
- return this;
- },
- serialize: function serialize(o) {
- var items = this._getItemsAsjQuery(o && o.connected),
- str = [];
-
- o = o || {};
- $(items).each(function () {
- var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || /(.+)[\-=_](.+)/);
-
- if (res) {
- str.push((o.key || res[1] + "[]") + "=" + (o.key && o.expression ? res[1] : res[2]));
- }
- });
-
- if (!str.length && o.key) {
- str.push(o.key + "=");
- }
-
- return str.join("&");
- },
- toArray: function toArray(o) {
- var items = this._getItemsAsjQuery(o && o.connected),
- ret = [];
-
- o = o || {};
- items.each(function () {
- ret.push($(o.item || this).attr(o.attribute || "id") || "");
- });
- return ret;
- },
-
- /* Be careful with the following core functions */
- _intersectsWith: function _intersectsWith(item) {
- var x1 = this.positionAbs.left,
- x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top,
- y2 = y1 + this.helperProportions.height,
- l = item.left,
- r = l + item.width,
- t = item.top,
- b = t + item.height,
- dyClick = this.offset.click.top,
- dxClick = this.offset.click.left,
- isOverElementHeight = this.options.axis === "x" || y1 + dyClick > t && y1 + dyClick < b,
- isOverElementWidth = this.options.axis === "y" || x1 + dxClick > l && x1 + dxClick < r,
- isOverElement = isOverElementHeight && isOverElementWidth;
-
- if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"]) {
- return isOverElement;
- } else {
- return l < x1 + this.helperProportions.width / 2 && // Right Half
- x2 - this.helperProportions.width / 2 < r && // Left Half
- t < y1 + this.helperProportions.height / 2 && // Bottom Half
- y2 - this.helperProportions.height / 2 < b; // Top Half
- }
- },
- _intersectsWithPointer: function _intersectsWithPointer(item) {
- var verticalDirection,
- horizontalDirection,
- isOverElementHeight = this.options.axis === "x" || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
- isOverElementWidth = this.options.axis === "y" || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
- isOverElement = isOverElementHeight && isOverElementWidth;
-
- if (!isOverElement) {
- return false;
- }
-
- verticalDirection = this.dragDirection.vertical;
- horizontalDirection = this.dragDirection.horizontal;
- return this.floating ? horizontalDirection === "right" || verticalDirection === "down" ? 2 : 1 : verticalDirection && (verticalDirection === "down" ? 2 : 1);
- },
- _intersectsWithSides: function _intersectsWithSides(item) {
- var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height / 2, item.height),
- isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width),
- verticalDirection = this.dragDirection.vertical,
- horizontalDirection = this.dragDirection.horizontal;
-
- if (this.floating && horizontalDirection) {
- return horizontalDirection === "right" && isOverRightHalf || horizontalDirection === "left" && !isOverRightHalf;
- } else {
- return verticalDirection && (verticalDirection === "down" && isOverBottomHalf || verticalDirection === "up" && !isOverBottomHalf);
- }
- },
- _getDragVerticalDirection: function _getDragVerticalDirection() {
- var delta = this.positionAbs.top - this.lastPositionAbs.top;
- return delta !== 0 && (delta > 0 ? "down" : "up");
- },
- _getDragHorizontalDirection: function _getDragHorizontalDirection() {
- var delta = this.positionAbs.left - this.lastPositionAbs.left;
- return delta !== 0 && (delta > 0 ? "right" : "left");
- },
- refresh: function refresh(event) {
- this._refreshItems(event);
-
- this._setHandleClassName();
-
- this.refreshPositions();
- return this;
- },
- _connectWith: function _connectWith() {
- var options = this.options;
- return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
- },
- _getItemsAsjQuery: function _getItemsAsjQuery(connected) {
- var i,
- j,
- cur,
- inst,
- items = [],
- queries = [],
- connectWith = this._connectWith();
-
- if (connectWith && connected) {
- for (i = connectWith.length - 1; i >= 0; i--) {
- cur = $(connectWith[i], this.document[0]);
-
- for (j = cur.length - 1; j >= 0; j--) {
- inst = $.data(cur[j], this.widgetFullName);
-
- if (inst && inst !== this && !inst.options.disabled) {
- queries.push([typeof inst.options.items === "function" ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
- }
- }
- }
- }
-
- queries.push([typeof this.options.items === "function" ? this.options.items.call(this.element, null, {
- options: this.options,
- item: this.currentItem
- }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
-
- function addItems() {
- items.push(this);
- }
-
- for (i = queries.length - 1; i >= 0; i--) {
- queries[i][0].each(addItems);
- }
-
- return $(items);
- },
- _removeCurrentsFromItems: function _removeCurrentsFromItems() {
- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
- this.items = $.grep(this.items, function (item) {
- for (var j = 0; j < list.length; j++) {
- if (list[j] === item.item[0]) {
- return false;
- }
- }
-
- return true;
- });
- },
- _refreshItems: function _refreshItems(event) {
- this.items = [];
- this.containers = [this];
-
- var i,
- j,
- cur,
- inst,
- targetData,
- _queries,
- item,
- queriesLength,
- items = this.items,
- queries = [[typeof this.options.items === "function" ? this.options.items.call(this.element[0], event, {
- item: this.currentItem
- }) : $(this.options.items, this.element), this]],
- connectWith = this._connectWith(); //Shouldn't be run the first time through due to massive slow-down
-
-
- if (connectWith && this.ready) {
- for (i = connectWith.length - 1; i >= 0; i--) {
- cur = $(connectWith[i], this.document[0]);
-
- for (j = cur.length - 1; j >= 0; j--) {
- inst = $.data(cur[j], this.widgetFullName);
-
- if (inst && inst !== this && !inst.options.disabled) {
- queries.push([typeof inst.options.items === "function" ? inst.options.items.call(inst.element[0], event, {
- item: this.currentItem
- }) : $(inst.options.items, inst.element), inst]);
- this.containers.push(inst);
- }
- }
- }
- }
-
- for (i = queries.length - 1; i >= 0; i--) {
- targetData = queries[i][1];
- _queries = queries[i][0];
-
- for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {
- item = $(_queries[j]); // Data for target checking (mouse manager)
-
- item.data(this.widgetName + "-item", targetData);
- items.push({
- item: item,
- instance: targetData,
- width: 0,
- height: 0,
- left: 0,
- top: 0
- });
- }
- }
- },
- _refreshItemPositions: function _refreshItemPositions(fast) {
- var i, item, t, p;
-
- for (i = this.items.length - 1; i >= 0; i--) {
- item = this.items[i]; //We ignore calculating positions of all connected containers when we're not over them
-
- if (this.currentContainer && item.instance !== this.currentContainer && item.item[0] !== this.currentItem[0]) {
- continue;
- }
-
- t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
-
- if (!fast) {
- item.width = t.outerWidth();
- item.height = t.outerHeight();
- }
-
- p = t.offset();
- item.left = p.left;
- item.top = p.top;
- }
- },
- refreshPositions: function refreshPositions(fast) {
- // Determine whether items are being displayed horizontally
- this.floating = this.items.length ? this.options.axis === "x" || this._isFloating(this.items[0].item) : false; // This has to be redone because due to the item being moved out/into the offsetParent,
- // the offsetParent's position will change
-
- if (this.offsetParent && this.helper) {
- this.offset.parent = this._getParentOffset();
- }
-
- this._refreshItemPositions(fast);
-
- var i, p;
-
- if (this.options.custom && this.options.custom.refreshContainers) {
- this.options.custom.refreshContainers.call(this);
- } else {
- for (i = this.containers.length - 1; i >= 0; i--) {
- p = this.containers[i].element.offset();
- this.containers[i].containerCache.left = p.left;
- this.containers[i].containerCache.top = p.top;
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
- }
- }
-
- return this;
- },
- _createPlaceholder: function _createPlaceholder(that) {
- that = that || this;
- var className,
- nodeName,
- o = that.options;
-
- if (!o.placeholder || o.placeholder.constructor === String) {
- className = o.placeholder;
- nodeName = that.currentItem[0].nodeName.toLowerCase();
- o.placeholder = {
- element: function element() {
- var element = $("<" + nodeName + ">", that.document[0]);
-
- that._addClass(element, "ui-sortable-placeholder", className || that.currentItem[0].className)._removeClass(element, "ui-sortable-helper");
-
- if (nodeName === "tbody") {
- that._createTrPlaceholder(that.currentItem.find("tr").eq(0), $("
", that.document[0]).appendTo(element));
- } else if (nodeName === "tr") {
- that._createTrPlaceholder(that.currentItem, element);
- } else if (nodeName === "img") {
- element.attr("src", that.currentItem.attr("src"));
- }
-
- if (!className) {
- element.css("visibility", "hidden");
- }
-
- return element;
- },
- update: function update(container, p) {
- // 1. If a className is set as 'placeholder option, we don't force sizes -
- // the class is responsible for that
- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
- // class name is specified
- if (className && !o.forcePlaceholderSize) {
- return;
- } // If the element doesn't have a actual height or width by itself (without
- // styles coming from a stylesheet), it receives the inline height and width
- // from the dragged item. Or, if it's a tbody or tr, it's going to have a height
- // anyway since we're populating them with s above, but they're unlikely to
- // be the correct height on their own if the row heights are dynamic, so we'll
- // always assign the height of the dragged item given forcePlaceholderSize
- // is true.
-
-
- if (!p.height() || o.forcePlaceholderSize && (nodeName === "tbody" || nodeName === "tr")) {
- p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop") || 0, 10) - parseInt(that.currentItem.css("paddingBottom") || 0, 10));
- }
-
- if (!p.width()) {
- p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft") || 0, 10) - parseInt(that.currentItem.css("paddingRight") || 0, 10));
- }
- }
- };
- } //Create the placeholder
-
-
- that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); //Append it after the actual current item
-
- that.currentItem.after(that.placeholder); //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
-
- o.placeholder.update(that, that.placeholder);
- },
- _createTrPlaceholder: function _createTrPlaceholder(sourceTr, targetTr) {
- var that = this;
- sourceTr.children().each(function () {
- $(" | | ", that.document[0]).attr("colspan", $(this).attr("colspan") || 1).appendTo(targetTr);
- });
- },
- _contactContainers: function _contactContainers(event) {
- var i,
- j,
- dist,
- itemWithLeastDistance,
- posProperty,
- sizeProperty,
- cur,
- nearBottom,
- floating,
- axis,
- innermostContainer = null,
- innermostIndex = null; // Get innermost container that intersects with item
-
- for (i = this.containers.length - 1; i >= 0; i--) {
- // Never consider a container that's located within the item itself
- if ($.contains(this.currentItem[0], this.containers[i].element[0])) {
- continue;
- }
-
- if (this._intersectsWith(this.containers[i].containerCache)) {
- // If we've already found a container and it's more "inner" than this, then continue
- if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
- continue;
- }
-
- innermostContainer = this.containers[i];
- innermostIndex = i;
- } else {
- // container doesn't intersect. trigger "out" event if necessary
- if (this.containers[i].containerCache.over) {
- this.containers[i]._trigger("out", event, this._uiHash(this));
-
- this.containers[i].containerCache.over = 0;
- }
- }
- } // If no intersecting containers found, return
-
-
- if (!innermostContainer) {
- return;
- } // Move the item into the container if it's not there already
-
-
- if (this.containers.length === 1) {
- if (!this.containers[innermostIndex].containerCache.over) {
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-
- this.containers[innermostIndex].containerCache.over = 1;
- }
- } else {
- // When entering a new container, we will find the item with the least distance and
- // append our item near it
- dist = 10000;
- itemWithLeastDistance = null;
- floating = innermostContainer.floating || this._isFloating(this.currentItem);
- posProperty = floating ? "left" : "top";
- sizeProperty = floating ? "width" : "height";
- axis = floating ? "pageX" : "pageY";
-
- for (j = this.items.length - 1; j >= 0; j--) {
- if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
- continue;
- }
-
- if (this.items[j].item[0] === this.currentItem[0]) {
- continue;
- }
-
- cur = this.items[j].item.offset()[posProperty];
- nearBottom = false;
-
- if (event[axis] - cur > this.items[j][sizeProperty] / 2) {
- nearBottom = true;
- }
-
- if (Math.abs(event[axis] - cur) < dist) {
- dist = Math.abs(event[axis] - cur);
- itemWithLeastDistance = this.items[j];
- this.direction = nearBottom ? "up" : "down";
- }
- } //Check if dropOnEmpty is enabled
-
-
- if (!itemWithLeastDistance && !this.options.dropOnEmpty) {
- return;
- }
-
- if (this.currentContainer === this.containers[innermostIndex]) {
- if (!this.currentContainer.containerCache.over) {
- this.containers[innermostIndex]._trigger("over", event, this._uiHash());
-
- this.currentContainer.containerCache.over = 1;
- }
-
- return;
- }
-
- if (itemWithLeastDistance) {
- this._rearrange(event, itemWithLeastDistance, null, true);
- } else {
- this._rearrange(event, null, this.containers[innermostIndex].element, true);
- }
-
- this._trigger("change", event, this._uiHash());
-
- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
-
- this.currentContainer = this.containers[innermostIndex]; //Update the placeholder
-
- this.options.placeholder.update(this.currentContainer, this.placeholder); //Update scrollParent
-
- this.scrollParent = this.placeholder.scrollParent(); //Update overflowOffset
-
- if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
- this.overflowOffset = this.scrollParent.offset();
- }
-
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-
- this.containers[innermostIndex].containerCache.over = 1;
- }
- },
- _createHelper: function _createHelper(event) {
- var o = this.options,
- helper = typeof o.helper === "function" ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : o.helper === "clone" ? this.currentItem.clone() : this.currentItem; //Add the helper to the DOM if that didn't happen already
-
- if (!helper.parents("body").length) {
- this.appendTo[0].appendChild(helper[0]);
- }
-
- if (helper[0] === this.currentItem[0]) {
- this._storedCSS = {
- width: this.currentItem[0].style.width,
- height: this.currentItem[0].style.height,
- position: this.currentItem.css("position"),
- top: this.currentItem.css("top"),
- left: this.currentItem.css("left")
- };
- }
-
- if (!helper[0].style.width || o.forceHelperSize) {
- helper.width(this.currentItem.width());
- }
-
- if (!helper[0].style.height || o.forceHelperSize) {
- helper.height(this.currentItem.height());
- }
-
- return helper;
- },
- _adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {
- if (typeof obj === "string") {
- obj = obj.split(" ");
- }
-
- if (Array.isArray(obj)) {
- obj = {
- left: +obj[0],
- top: +obj[1] || 0
- };
- }
-
- if ("left" in obj) {
- this.offset.click.left = obj.left + this.margins.left;
- }
-
- if ("right" in obj) {
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- }
-
- if ("top" in obj) {
- this.offset.click.top = obj.top + this.margins.top;
- }
-
- if ("bottom" in obj) {
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- }
- },
- _getParentOffset: function _getParentOffset() {
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset(); // This is a special case where we need to modify a offset calculated on start, since the
- // following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the
- // next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
- // the document, which means that the scroll is included in the initial calculation of the
- // offset of the parent, and never recalculated upon drag
-
- if (this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- } // This needs to be actually done for all browsers, since pageX/pageY includes this
- // information with an ugly IE fix
-
-
- if (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie) {
- po = {
- top: 0,
- left: 0
- };
- }
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
- };
- },
- _getRelativeOffset: function _getRelativeOffset() {
- if (this.cssPosition === "relative") {
- var p = this.currentItem.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return {
- top: 0,
- left: 0
- };
- }
- },
- _cacheMargins: function _cacheMargins() {
- this.margins = {
- left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
- top: parseInt(this.currentItem.css("marginTop"), 10) || 0
- };
- },
- _cacheHelperProportions: function _cacheHelperProportions() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
- _setContainment: function _setContainment() {
- var ce,
- co,
- over,
- o = this.options;
-
- if (o.containment === "parent") {
- o.containment = this.helper[0].parentNode;
- }
-
- if (o.containment === "document" || o.containment === "window") {
- this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (o.containment === "document" ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
- }
-
- if (!/^(document|window|parent)$/.test(o.containment)) {
- ce = $(o.containment)[0];
- co = $(o.containment).offset();
- over = $(ce).css("overflow") !== "hidden";
- this.containment = [co.left + (parseInt($(ce).css("borderLeftWidth"), 10) || 0) + (parseInt($(ce).css("paddingLeft"), 10) || 0) - this.margins.left, co.top + (parseInt($(ce).css("borderTopWidth"), 10) || 0) + (parseInt($(ce).css("paddingTop"), 10) || 0) - this.margins.top, co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"), 10) || 0) - (parseInt($(ce).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"), 10) || 0) - (parseInt($(ce).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top];
- }
- },
- _convertPositionTo: function _convertPositionTo(d, pos) {
- if (!pos) {
- pos = this.position;
- }
-
- var mod = d === "absolute" ? 1 : -1,
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
- scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);
- return {
- top: // The absolute mouse position
- pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border)
- this.offset.parent.top * mod - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()) * mod,
- left: // The absolute mouse position
- pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border)
- this.offset.parent.left * mod - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod
- };
- },
- _generatePosition: function _generatePosition(event) {
- var top,
- left,
- o = this.options,
- pageX = event.pageX,
- pageY = event.pageY,
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
- scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName); // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
-
- if (this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
-
- if (this.originalPosition) {
- //If we are not dragging yet, we won't check for options
- if (this.containment) {
- if (event.pageX - this.offset.click.left < this.containment[0]) {
- pageX = this.containment[0] + this.offset.click.left;
- }
-
- if (event.pageY - this.offset.click.top < this.containment[1]) {
- pageY = this.containment[1] + this.offset.click.top;
- }
-
- if (event.pageX - this.offset.click.left > this.containment[2]) {
- pageX = this.containment[2] + this.offset.click.left;
- }
-
- if (event.pageY - this.offset.click.top > this.containment[3]) {
- pageY = this.containment[3] + this.offset.click.top;
- }
- }
-
- if (o.grid) {
- top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3] ? top : top - this.offset.click.top >= this.containment[1] ? top - o.grid[1] : top + o.grid[1] : top;
- left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2] ? left : left - this.offset.click.left >= this.containment[0] ? left - o.grid[0] : left + o.grid[0] : left;
- }
- }
-
- return {
- top: // The absolute mouse position
- pageY - // Click offset (relative to the element)
- this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.top - // The offsetParent's offset without borders (offset + border)
- this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()),
- left: // The absolute mouse position
- pageX - // Click offset (relative to the element)
- this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.relative.left - // The offsetParent's offset without borders (offset + border)
- this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft())
- };
- },
- _rearrange: function _rearrange(event, i, a, hardRefresh) {
- if (a) {
- a[0].appendChild(this.placeholder[0]);
- } else {
- i.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === "down" ? i.item[0] : i.item[0].nextSibling);
- } //Various things done here to improve the performance:
- // 1. we create a setTimeout, that calls refreshPositions
- // 2. on the instance, we have a counter variable, that get's higher after every append
- // 3. on the local scope, we copy the counter variable, and check in the timeout,
- // if it's still the same
- // 4. this lets only the last addition to the timeout stack through
-
-
- this.counter = this.counter ? ++this.counter : 1;
- var counter = this.counter;
-
- this._delay(function () {
- if (counter === this.counter) {
- //Precompute after each DOM insertion, NOT on mousemove
- this.refreshPositions(!hardRefresh);
- }
- });
- },
- _clear: function _clear(event, noPropagation) {
- this.reverting = false; // We delay all events that have to be triggered to after the point where the placeholder
- // has been removed and everything else normalized again
-
- var i,
- delayedTriggers = []; // We first have to update the dom position of the actual currentItem
- // Note: don't do it if the current item is already removed (by a user), or it gets
- // reappended (see #4088)
-
- if (!this._noFinalSort && this.currentItem.parent().length) {
- this.placeholder.before(this.currentItem);
- }
-
- this._noFinalSort = null;
-
- if (this.helper[0] === this.currentItem[0]) {
- for (i in this._storedCSS) {
- if (this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
- this._storedCSS[i] = "";
- }
- }
-
- this.currentItem.css(this._storedCSS);
-
- this._removeClass(this.currentItem, "ui-sortable-helper");
- } else {
- this.currentItem.show();
- }
-
- if (this.fromOutside && !noPropagation) {
- delayedTriggers.push(function (event) {
- this._trigger("receive", event, this._uiHash(this.fromOutside));
- });
- }
-
- if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
- // Trigger update callback if the DOM position has changed
- delayedTriggers.push(function (event) {
- this._trigger("update", event, this._uiHash());
- });
- } // Check if the items Container has Changed and trigger appropriate
- // events.
-
-
- if (this !== this.currentContainer) {
- if (!noPropagation) {
- delayedTriggers.push(function (event) {
- this._trigger("remove", event, this._uiHash());
- });
- delayedTriggers.push(function (c) {
- return function (event) {
- c._trigger("receive", event, this._uiHash(this));
- };
- }.call(this, this.currentContainer));
- delayedTriggers.push(function (c) {
- return function (event) {
- c._trigger("update", event, this._uiHash(this));
- };
- }.call(this, this.currentContainer));
- }
- } //Post events to containers
-
-
- function delayEvent(type, instance, container) {
- return function (event) {
- container._trigger(type, event, instance._uiHash(instance));
- };
- }
-
- for (i = this.containers.length - 1; i >= 0; i--) {
- if (!noPropagation) {
- delayedTriggers.push(delayEvent("deactivate", this, this.containers[i]));
- }
-
- if (this.containers[i].containerCache.over) {
- delayedTriggers.push(delayEvent("out", this, this.containers[i]));
- this.containers[i].containerCache.over = 0;
- }
- } //Do what was originally in plugins
-
-
- if (this.storedCursor) {
- this.document.find("body").css("cursor", this.storedCursor);
- this.storedStylesheet.remove();
- }
-
- if (this._storedOpacity) {
- this.helper.css("opacity", this._storedOpacity);
- }
-
- if (this._storedZIndex) {
- this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
- }
-
- this.dragging = false;
-
- if (!noPropagation) {
- this._trigger("beforeStop", event, this._uiHash());
- } //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
- // it unbinds ALL events from the original node!
-
-
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-
- if (!this.cancelHelperRemoval) {
- if (this.helper[0] !== this.currentItem[0]) {
- this.helper.remove();
- }
-
- this.helper = null;
- }
-
- if (!noPropagation) {
- for (i = 0; i < delayedTriggers.length; i++) {
- // Trigger all delayed events
- delayedTriggers[i].call(this, event);
- }
-
- this._trigger("stop", event, this._uiHash());
- }
-
- this.fromOutside = false;
- return !this.cancelHelperRemoval;
- },
- _trigger: function _trigger() {
- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
- this.cancel();
- }
- },
- _uiHash: function _uiHash(_inst) {
- var inst = _inst || this;
- return {
- helper: inst.helper,
- placeholder: inst.placeholder || $([]),
- position: inst.position,
- originalPosition: inst.originalPosition,
- offset: inst.positionAbs,
- item: inst.currentItem,
- sender: _inst ? _inst.element : null
- };
- }
- });
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ui/ui/widgets/tabs.js":
-/*!***************************************************!*\
- !*** ./node_modules/jquery-ui/ui/widgets/tabs.js ***!
- \***************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery UI Tabs 1.13.1
- * http://jqueryui.com
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-//>>label: Tabs
-//>>group: Widgets
-//>>description: Transforms a set of container elements into a tab structure.
-//>>docs: http://api.jqueryui.com/tabs/
-//>>demos: http://jqueryui.com/tabs/
-//>>css.structure: ../../themes/base/core.css
-//>>css.structure: ../../themes/base/tabs.css
-//>>css.theme: ../../themes/base/theme.css
-(function (factory) {
- "use strict";
-
- if (true) {
- // AMD. Register as an anonymous module.
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! ../keycode */ "./node_modules/jquery-ui/ui/keycode.js"), __webpack_require__(/*! ../safe-active-element */ "./node_modules/jquery-ui/ui/safe-active-element.js"), __webpack_require__(/*! ../unique-id */ "./node_modules/jquery-ui/ui/unique-id.js"), __webpack_require__(/*! ../version */ "./node_modules/jquery-ui/ui/version.js"), __webpack_require__(/*! ../widget */ "./node_modules/jquery-ui/ui/widget.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-})(function ($) {
- "use strict";
-
- $.widget("ui.tabs", {
- version: "1.13.1",
- delay: 300,
- options: {
- active: null,
- classes: {
- "ui-tabs": "ui-corner-all",
- "ui-tabs-nav": "ui-corner-all",
- "ui-tabs-panel": "ui-corner-bottom",
- "ui-tabs-tab": "ui-corner-top"
- },
- collapsible: false,
- event: "click",
- heightStyle: "content",
- hide: null,
- show: null,
- // Callbacks
- activate: null,
- beforeActivate: null,
- beforeLoad: null,
- load: null
- },
- _isLocal: function () {
- var rhash = /#.*$/;
- return function (anchor) {
- var anchorUrl, locationUrl;
- anchorUrl = anchor.href.replace(rhash, "");
- locationUrl = location.href.replace(rhash, ""); // Decoding may throw an error if the URL isn't UTF-8 (#9518)
-
- try {
- anchorUrl = decodeURIComponent(anchorUrl);
- } catch (error) {}
-
- try {
- locationUrl = decodeURIComponent(locationUrl);
- } catch (error) {}
-
- return anchor.hash.length > 1 && anchorUrl === locationUrl;
- };
- }(),
- _create: function _create() {
- var that = this,
- options = this.options;
- this.running = false;
-
- this._addClass("ui-tabs", "ui-widget ui-widget-content");
-
- this._toggleClass("ui-tabs-collapsible", null, options.collapsible);
-
- this._processTabs();
-
- options.active = this._initialActive(); // Take disabling tabs via class attribute from HTML
- // into account and update option properly.
-
- if (Array.isArray(options.disabled)) {
- options.disabled = $.uniqueSort(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"), function (li) {
- return that.tabs.index(li);
- }))).sort();
- } // Check for length avoids error when initializing empty list
-
-
- if (this.options.active !== false && this.anchors.length) {
- this.active = this._findActive(options.active);
- } else {
- this.active = $();
- }
-
- this._refresh();
-
- if (this.active.length) {
- this.load(options.active);
- }
- },
- _initialActive: function _initialActive() {
- var active = this.options.active,
- collapsible = this.options.collapsible,
- locationHash = location.hash.substring(1);
-
- if (active === null) {
- // check the fragment identifier in the URL
- if (locationHash) {
- this.tabs.each(function (i, tab) {
- if ($(tab).attr("aria-controls") === locationHash) {
- active = i;
- return false;
- }
- });
- } // Check for a tab marked active via a class
-
-
- if (active === null) {
- active = this.tabs.index(this.tabs.filter(".ui-tabs-active"));
- } // No active tab, set to false
-
-
- if (active === null || active === -1) {
- active = this.tabs.length ? 0 : false;
- }
- } // Handle numbers: negative, out of range
-
-
- if (active !== false) {
- active = this.tabs.index(this.tabs.eq(active));
-
- if (active === -1) {
- active = collapsible ? false : 0;
- }
- } // Don't allow collapsible: false and active: false
-
-
- if (!collapsible && active === false && this.anchors.length) {
- active = 0;
- }
-
- return active;
- },
- _getCreateEventData: function _getCreateEventData() {
- return {
- tab: this.active,
- panel: !this.active.length ? $() : this._getPanelForTab(this.active)
- };
- },
- _tabKeydown: function _tabKeydown(event) {
- var focusedTab = $($.ui.safeActiveElement(this.document[0])).closest("li"),
- selectedIndex = this.tabs.index(focusedTab),
- goingForward = true;
-
- if (this._handlePageNav(event)) {
- return;
- }
-
- switch (event.keyCode) {
- case $.ui.keyCode.RIGHT:
- case $.ui.keyCode.DOWN:
- selectedIndex++;
- break;
-
- case $.ui.keyCode.UP:
- case $.ui.keyCode.LEFT:
- goingForward = false;
- selectedIndex--;
- break;
-
- case $.ui.keyCode.END:
- selectedIndex = this.anchors.length - 1;
- break;
-
- case $.ui.keyCode.HOME:
- selectedIndex = 0;
- break;
-
- case $.ui.keyCode.SPACE:
- // Activate only, no collapsing
- event.preventDefault();
- clearTimeout(this.activating);
-
- this._activate(selectedIndex);
-
- return;
-
- case $.ui.keyCode.ENTER:
- // Toggle (cancel delayed activation, allow collapsing)
- event.preventDefault();
- clearTimeout(this.activating); // Determine if we should collapse or activate
-
- this._activate(selectedIndex === this.options.active ? false : selectedIndex);
-
- return;
-
- default:
- return;
- } // Focus the appropriate tab, based on which key was pressed
-
-
- event.preventDefault();
- clearTimeout(this.activating);
- selectedIndex = this._focusNextTab(selectedIndex, goingForward); // Navigating with control/command key will prevent automatic activation
-
- if (!event.ctrlKey && !event.metaKey) {
- // Update aria-selected immediately so that AT think the tab is already selected.
- // Otherwise AT may confuse the user by stating that they need to activate the tab,
- // but the tab will already be activated by the time the announcement finishes.
- focusedTab.attr("aria-selected", "false");
- this.tabs.eq(selectedIndex).attr("aria-selected", "true");
- this.activating = this._delay(function () {
- this.option("active", selectedIndex);
- }, this.delay);
- }
- },
- _panelKeydown: function _panelKeydown(event) {
- if (this._handlePageNav(event)) {
- return;
- } // Ctrl+up moves focus to the current tab
-
-
- if (event.ctrlKey && event.keyCode === $.ui.keyCode.UP) {
- event.preventDefault();
- this.active.trigger("focus");
- }
- },
- // Alt+page up/down moves focus to the previous/next tab (and activates)
- _handlePageNav: function _handlePageNav(event) {
- if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP) {
- this._activate(this._focusNextTab(this.options.active - 1, false));
-
- return true;
- }
-
- if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN) {
- this._activate(this._focusNextTab(this.options.active + 1, true));
-
- return true;
- }
- },
- _findNextTab: function _findNextTab(index, goingForward) {
- var lastTabIndex = this.tabs.length - 1;
-
- function constrain() {
- if (index > lastTabIndex) {
- index = 0;
- }
-
- if (index < 0) {
- index = lastTabIndex;
- }
-
- return index;
- }
-
- while ($.inArray(constrain(), this.options.disabled) !== -1) {
- index = goingForward ? index + 1 : index - 1;
- }
-
- return index;
- },
- _focusNextTab: function _focusNextTab(index, goingForward) {
- index = this._findNextTab(index, goingForward);
- this.tabs.eq(index).trigger("focus");
- return index;
- },
- _setOption: function _setOption(key, value) {
- if (key === "active") {
- // _activate() will handle invalid values and update this.options
- this._activate(value);
-
- return;
- }
-
- this._super(key, value);
-
- if (key === "collapsible") {
- this._toggleClass("ui-tabs-collapsible", null, value); // Setting collapsible: false while collapsed; open first panel
-
-
- if (!value && this.options.active === false) {
- this._activate(0);
- }
- }
-
- if (key === "event") {
- this._setupEvents(value);
- }
-
- if (key === "heightStyle") {
- this._setupHeightStyle(value);
- }
- },
- _sanitizeSelector: function _sanitizeSelector(hash) {
- return hash ? hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : "";
- },
- refresh: function refresh() {
- var options = this.options,
- lis = this.tablist.children(":has(a[href])"); // Get disabled tabs from class attribute from HTML
- // this will get converted to a boolean if needed in _refresh()
-
- options.disabled = $.map(lis.filter(".ui-state-disabled"), function (tab) {
- return lis.index(tab);
- });
-
- this._processTabs(); // Was collapsed or no tabs
-
-
- if (options.active === false || !this.anchors.length) {
- options.active = false;
- this.active = $(); // was active, but active tab is gone
- } else if (this.active.length && !$.contains(this.tablist[0], this.active[0])) {
- // all remaining tabs are disabled
- if (this.tabs.length === options.disabled.length) {
- options.active = false;
- this.active = $(); // activate previous tab
- } else {
- this._activate(this._findNextTab(Math.max(0, options.active - 1), false));
- } // was active, active tab still exists
-
- } else {
- // make sure active index is correct
- options.active = this.tabs.index(this.active);
- }
-
- this._refresh();
- },
- _refresh: function _refresh() {
- this._setOptionDisabled(this.options.disabled);
-
- this._setupEvents(this.options.event);
-
- this._setupHeightStyle(this.options.heightStyle);
-
- this.tabs.not(this.active).attr({
- "aria-selected": "false",
- "aria-expanded": "false",
- tabIndex: -1
- });
- this.panels.not(this._getPanelForTab(this.active)).hide().attr({
- "aria-hidden": "true"
- }); // Make sure one tab is in the tab order
-
- if (!this.active.length) {
- this.tabs.eq(0).attr("tabIndex", 0);
- } else {
- this.active.attr({
- "aria-selected": "true",
- "aria-expanded": "true",
- tabIndex: 0
- });
-
- this._addClass(this.active, "ui-tabs-active", "ui-state-active");
-
- this._getPanelForTab(this.active).show().attr({
- "aria-hidden": "false"
- });
- }
- },
- _processTabs: function _processTabs() {
- var that = this,
- prevTabs = this.tabs,
- prevAnchors = this.anchors,
- prevPanels = this.panels;
- this.tablist = this._getList().attr("role", "tablist");
-
- this._addClass(this.tablist, "ui-tabs-nav", "ui-helper-reset ui-helper-clearfix ui-widget-header"); // Prevent users from focusing disabled tabs via click
-
-
- this.tablist.on("mousedown" + this.eventNamespace, "> li", function (event) {
- if ($(this).is(".ui-state-disabled")) {
- event.preventDefault();
- }
- }) // Support: IE <9
- // Preventing the default action in mousedown doesn't prevent IE
- // from focusing the element, so if the anchor gets focused, blur.
- // We don't have to worry about focusing the previously focused
- // element since clicking on a non-focusable element should focus
- // the body anyway.
- .on("focus" + this.eventNamespace, ".ui-tabs-anchor", function () {
- if ($(this).closest("li").is(".ui-state-disabled")) {
- this.blur();
- }
- });
- this.tabs = this.tablist.find("> li:has(a[href])").attr({
- role: "tab",
- tabIndex: -1
- });
-
- this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default");
-
- this.anchors = this.tabs.map(function () {
- return $("a", this)[0];
- }).attr({
- tabIndex: -1
- });
-
- this._addClass(this.anchors, "ui-tabs-anchor");
-
- this.panels = $();
- this.anchors.each(function (i, anchor) {
- var selector,
- panel,
- panelId,
- anchorId = $(anchor).uniqueId().attr("id"),
- tab = $(anchor).closest("li"),
- originalAriaControls = tab.attr("aria-controls"); // Inline tab
-
- if (that._isLocal(anchor)) {
- selector = anchor.hash;
- panelId = selector.substring(1);
- panel = that.element.find(that._sanitizeSelector(selector)); // remote tab
- } else {
- // If the tab doesn't already have aria-controls,
- // generate an id by using a throw-away element
- panelId = tab.attr("aria-controls") || $({}).uniqueId()[0].id;
- selector = "#" + panelId;
- panel = that.element.find(selector);
-
- if (!panel.length) {
- panel = that._createPanel(panelId);
- panel.insertAfter(that.panels[i - 1] || that.tablist);
- }
-
- panel.attr("aria-live", "polite");
- }
-
- if (panel.length) {
- that.panels = that.panels.add(panel);
- }
-
- if (originalAriaControls) {
- tab.data("ui-tabs-aria-controls", originalAriaControls);
- }
-
- tab.attr({
- "aria-controls": panelId,
- "aria-labelledby": anchorId
- });
- panel.attr("aria-labelledby", anchorId);
- });
- this.panels.attr("role", "tabpanel");
-
- this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content"); // Avoid memory leaks (#10056)
-
-
- if (prevTabs) {
- this._off(prevTabs.not(this.tabs));
-
- this._off(prevAnchors.not(this.anchors));
-
- this._off(prevPanels.not(this.panels));
- }
- },
- // Allow overriding how to find the list for rare usage scenarios (#7715)
- _getList: function _getList() {
- return this.tablist || this.element.find("ol, ul").eq(0);
- },
- _createPanel: function _createPanel(id) {
- return $("").attr("id", id).data("ui-tabs-destroy", true);
- },
- _setOptionDisabled: function _setOptionDisabled(disabled) {
- var currentItem, li, i;
-
- if (Array.isArray(disabled)) {
- if (!disabled.length) {
- disabled = false;
- } else if (disabled.length === this.anchors.length) {
- disabled = true;
- }
- } // Disable tabs
-
-
- for (i = 0; li = this.tabs[i]; i++) {
- currentItem = $(li);
-
- if (disabled === true || $.inArray(i, disabled) !== -1) {
- currentItem.attr("aria-disabled", "true");
-
- this._addClass(currentItem, null, "ui-state-disabled");
- } else {
- currentItem.removeAttr("aria-disabled");
-
- this._removeClass(currentItem, null, "ui-state-disabled");
- }
- }
-
- this.options.disabled = disabled;
-
- this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, disabled === true);
- },
- _setupEvents: function _setupEvents(event) {
- var events = {};
-
- if (event) {
- $.each(event.split(" "), function (index, eventName) {
- events[eventName] = "_eventHandler";
- });
- }
-
- this._off(this.anchors.add(this.tabs).add(this.panels)); // Always prevent the default action, even when disabled
-
-
- this._on(true, this.anchors, {
- click: function click(event) {
- event.preventDefault();
- }
- });
-
- this._on(this.anchors, events);
-
- this._on(this.tabs, {
- keydown: "_tabKeydown"
- });
-
- this._on(this.panels, {
- keydown: "_panelKeydown"
- });
-
- this._focusable(this.tabs);
-
- this._hoverable(this.tabs);
- },
- _setupHeightStyle: function _setupHeightStyle(heightStyle) {
- var maxHeight,
- parent = this.element.parent();
-
- if (heightStyle === "fill") {
- maxHeight = parent.height();
- maxHeight -= this.element.outerHeight() - this.element.height();
- this.element.siblings(":visible").each(function () {
- var elem = $(this),
- position = elem.css("position");
-
- if (position === "absolute" || position === "fixed") {
- return;
- }
-
- maxHeight -= elem.outerHeight(true);
- });
- this.element.children().not(this.panels).each(function () {
- maxHeight -= $(this).outerHeight(true);
- });
- this.panels.each(function () {
- $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));
- }).css("overflow", "auto");
- } else if (heightStyle === "auto") {
- maxHeight = 0;
- this.panels.each(function () {
- maxHeight = Math.max(maxHeight, $(this).height("").height());
- }).height(maxHeight);
- }
- },
- _eventHandler: function _eventHandler(event) {
- var options = this.options,
- active = this.active,
- anchor = $(event.currentTarget),
- tab = anchor.closest("li"),
- clickedIsActive = tab[0] === active[0],
- collapsing = clickedIsActive && options.collapsible,
- toShow = collapsing ? $() : this._getPanelForTab(tab),
- toHide = !active.length ? $() : this._getPanelForTab(active),
- eventData = {
- oldTab: active,
- oldPanel: toHide,
- newTab: collapsing ? $() : tab,
- newPanel: toShow
- };
- event.preventDefault();
-
- if (tab.hasClass("ui-state-disabled") || // tab is already loading
- tab.hasClass("ui-tabs-loading") || // can't switch durning an animation
- this.running || // click on active header, but not collapsible
- clickedIsActive && !options.collapsible || // allow canceling activation
- this._trigger("beforeActivate", event, eventData) === false) {
- return;
- }
-
- options.active = collapsing ? false : this.tabs.index(tab);
- this.active = clickedIsActive ? $() : tab;
-
- if (this.xhr) {
- this.xhr.abort();
- }
-
- if (!toHide.length && !toShow.length) {
- $.error("jQuery UI Tabs: Mismatching fragment identifier.");
- }
-
- if (toShow.length) {
- this.load(this.tabs.index(tab), event);
- }
-
- this._toggle(event, eventData);
- },
- // Handles show/hide for selecting tabs
- _toggle: function _toggle(event, eventData) {
- var that = this,
- toShow = eventData.newPanel,
- toHide = eventData.oldPanel;
- this.running = true;
-
- function complete() {
- that.running = false;
-
- that._trigger("activate", event, eventData);
- }
-
- function show() {
- that._addClass(eventData.newTab.closest("li"), "ui-tabs-active", "ui-state-active");
-
- if (toShow.length && that.options.show) {
- that._show(toShow, that.options.show, complete);
- } else {
- toShow.show();
- complete();
- }
- } // Start out by hiding, then showing, then completing
-
-
- if (toHide.length && this.options.hide) {
- this._hide(toHide, this.options.hide, function () {
- that._removeClass(eventData.oldTab.closest("li"), "ui-tabs-active", "ui-state-active");
-
- show();
- });
- } else {
- this._removeClass(eventData.oldTab.closest("li"), "ui-tabs-active", "ui-state-active");
-
- toHide.hide();
- show();
- }
-
- toHide.attr("aria-hidden", "true");
- eventData.oldTab.attr({
- "aria-selected": "false",
- "aria-expanded": "false"
- }); // If we're switching tabs, remove the old tab from the tab order.
- // If we're opening from collapsed state, remove the previous tab from the tab order.
- // If we're collapsing, then keep the collapsing tab in the tab order.
-
- if (toShow.length && toHide.length) {
- eventData.oldTab.attr("tabIndex", -1);
- } else if (toShow.length) {
- this.tabs.filter(function () {
- return $(this).attr("tabIndex") === 0;
- }).attr("tabIndex", -1);
- }
-
- toShow.attr("aria-hidden", "false");
- eventData.newTab.attr({
- "aria-selected": "true",
- "aria-expanded": "true",
- tabIndex: 0
- });
- },
- _activate: function _activate(index) {
- var anchor,
- active = this._findActive(index); // Trying to activate the already active panel
-
-
- if (active[0] === this.active[0]) {
- return;
- } // Trying to collapse, simulate a click on the current active header
-
-
- if (!active.length) {
- active = this.active;
- }
-
- anchor = active.find(".ui-tabs-anchor")[0];
-
- this._eventHandler({
- target: anchor,
- currentTarget: anchor,
- preventDefault: $.noop
- });
- },
- _findActive: function _findActive(index) {
- return index === false ? $() : this.tabs.eq(index);
- },
- _getIndex: function _getIndex(index) {
- // meta-function to give users option to provide a href string instead of a numerical index.
- if (typeof index === "string") {
- index = this.anchors.index(this.anchors.filter("[href$='" + $.escapeSelector(index) + "']"));
- }
-
- return index;
- },
- _destroy: function _destroy() {
- if (this.xhr) {
- this.xhr.abort();
- }
-
- this.tablist.removeAttr("role").off(this.eventNamespace);
- this.anchors.removeAttr("role tabIndex").removeUniqueId();
- this.tabs.add(this.panels).each(function () {
- if ($.data(this, "ui-tabs-destroy")) {
- $(this).remove();
- } else {
- $(this).removeAttr("role tabIndex " + "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded");
- }
- });
- this.tabs.each(function () {
- var li = $(this),
- prev = li.data("ui-tabs-aria-controls");
-
- if (prev) {
- li.attr("aria-controls", prev).removeData("ui-tabs-aria-controls");
- } else {
- li.removeAttr("aria-controls");
- }
- });
- this.panels.show();
-
- if (this.options.heightStyle !== "content") {
- this.panels.css("height", "");
- }
- },
- enable: function enable(index) {
- var disabled = this.options.disabled;
-
- if (disabled === false) {
- return;
- }
-
- if (index === undefined) {
- disabled = false;
- } else {
- index = this._getIndex(index);
-
- if (Array.isArray(disabled)) {
- disabled = $.map(disabled, function (num) {
- return num !== index ? num : null;
- });
- } else {
- disabled = $.map(this.tabs, function (li, num) {
- return num !== index ? num : null;
- });
- }
- }
-
- this._setOptionDisabled(disabled);
- },
- disable: function disable(index) {
- var disabled = this.options.disabled;
-
- if (disabled === true) {
- return;
- }
-
- if (index === undefined) {
- disabled = true;
- } else {
- index = this._getIndex(index);
-
- if ($.inArray(index, disabled) !== -1) {
- return;
- }
-
- if (Array.isArray(disabled)) {
- disabled = $.merge([index], disabled).sort();
- } else {
- disabled = [index];
- }
- }
-
- this._setOptionDisabled(disabled);
- },
- load: function load(index, event) {
- index = this._getIndex(index);
-
- var that = this,
- tab = this.tabs.eq(index),
- anchor = tab.find(".ui-tabs-anchor"),
- panel = this._getPanelForTab(tab),
- eventData = {
- tab: tab,
- panel: panel
- },
- complete = function complete(jqXHR, status) {
- if (status === "abort") {
- that.panels.stop(false, true);
- }
-
- that._removeClass(tab, "ui-tabs-loading");
-
- panel.removeAttr("aria-busy");
-
- if (jqXHR === that.xhr) {
- delete that.xhr;
- }
- }; // Not remote
-
-
- if (this._isLocal(anchor[0])) {
- return;
- }
-
- this.xhr = $.ajax(this._ajaxSettings(anchor, event, eventData)); // Support: jQuery <1.8
- // jQuery <1.8 returns false if the request is canceled in beforeSend,
- // but as of 1.8, $.ajax() always returns a jqXHR object.
-
- if (this.xhr && this.xhr.statusText !== "canceled") {
- this._addClass(tab, "ui-tabs-loading");
-
- panel.attr("aria-busy", "true");
- this.xhr.done(function (response, status, jqXHR) {
- // support: jQuery <1.8
- // http://bugs.jquery.com/ticket/11778
- setTimeout(function () {
- panel.html(response);
-
- that._trigger("load", event, eventData);
-
- complete(jqXHR, status);
- }, 1);
- }).fail(function (jqXHR, status) {
- // support: jQuery <1.8
- // http://bugs.jquery.com/ticket/11778
- setTimeout(function () {
- complete(jqXHR, status);
- }, 1);
- });
- }
- },
- _ajaxSettings: function _ajaxSettings(anchor, event, eventData) {
- var that = this;
- return {
- // Support: IE <11 only
- // Strip any hash that exists to prevent errors with the Ajax request
- url: anchor.attr("href").replace(/#.*$/, ""),
- beforeSend: function beforeSend(jqXHR, settings) {
- return that._trigger("beforeLoad", event, $.extend({
- jqXHR: jqXHR,
- ajaxSettings: settings
- }, eventData));
- }
- };
- },
- _getPanelForTab: function _getPanelForTab(tab) {
- var id = $(tab).attr("aria-controls");
- return this.element.find(this._sanitizeSelector("#" + id));
- }
- }); // DEPRECATED
- // TODO: Switch return back to widget declaration at top of file when this is removed
-
- if ($.uiBackCompat !== false) {
- // Backcompat for ui-tab class (now ui-tabs-tab)
- $.widget("ui.tabs", $.ui.tabs, {
- _processTabs: function _processTabs() {
- this._superApply(arguments);
-
- this._addClass(this.tabs, "ui-tab");
- }
- });
- }
-
- return $.ui.tabs;
-});
-
-/***/ }),
-
-/***/ "./node_modules/jquery-ujs/src/rails.js":
-/*!**********************************************!*\
- !*** ./node_modules/jquery-ujs/src/rails.js ***!
- \**********************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-
-/* jshint node: true */
-
-/**
- * Unobtrusive scripting adapter for jQuery
- * https://github.com/rails/jquery-ujs
- *
- * Requires jQuery 1.8.0 or later.
- *
- * Released under the MIT license
- *
- */
-(function () {
- 'use strict';
-
- var jqueryUjsInit = function jqueryUjsInit($, undefined) {
- // Cut down on the number of issues from people inadvertently including jquery_ujs twice
- // by detecting and raising an error when it happens.
- if ($.rails !== undefined) {
- $.error('jquery-ujs has already been loaded!');
- } // Shorthand to make it a little easier to call public rails functions from within rails.js
-
-
- var rails;
- var $document = $(document);
- $.rails = rails = {
- // Link elements bound by jquery-ujs
- linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',
- // Button elements bound by jquery-ujs
- buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)',
- // Select elements bound by jquery-ujs
- inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
- // Form elements bound by jquery-ujs
- formSubmitSelector: 'form:not([data-turbo=true])',
- // Form input elements bound by jquery-ujs
- formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',
- // Form input elements disabled during form submission
- disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',
- // Form input elements re-enabled after form submission
- enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',
- // Form required input elements
- requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])',
- // Form file input elements
- fileInputSelector: 'input[name][type=file]:not([disabled])',
- // Link onClick disable selector with possible reenable after remote submission
- linkDisableSelector: 'a[data-disable-with], a[data-disable]',
- // Button onClick disable selector with possible reenable after remote submission
- buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]',
- // Up-to-date Cross-Site Request Forgery token
- csrfToken: function csrfToken() {
- return $('meta[name=csrf-token]').attr('content');
- },
- // URL param that must contain the CSRF token
- csrfParam: function csrfParam() {
- return $('meta[name=csrf-param]').attr('content');
- },
- // Make sure that every Ajax request sends the CSRF token
- CSRFProtection: function CSRFProtection(xhr) {
- var token = rails.csrfToken();
- if (token) xhr.setRequestHeader('X-CSRF-Token', token);
- },
- // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones)
- refreshCSRFTokens: function refreshCSRFTokens() {
- $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken());
- },
- // Triggers an event on an element and returns false if the event result is false
- fire: function fire(obj, name, data) {
- var event = $.Event(name);
- obj.trigger(event, data);
- return event.result !== false;
- },
- // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
- confirm: function (_confirm) {
- function confirm(_x) {
- return _confirm.apply(this, arguments);
- }
-
- confirm.toString = function () {
- return _confirm.toString();
- };
-
- return confirm;
- }(function (message) {
- return confirm(message);
- }),
- // Default ajax function, may be overridden with custom function in $.rails.ajax
- ajax: function ajax(options) {
- return $.ajax(options);
- },
- // Default way to get an element's href. May be overridden at $.rails.href.
- href: function href(element) {
- return element[0].href;
- },
- // Checks "data-remote" if true to handle the request through a XHR request.
- isRemote: function isRemote(element) {
- return element.data('remote') !== undefined && element.data('remote') !== false;
- },
- // Submits "remote" forms and links with ajax
- handleRemote: function handleRemote(element) {
- var method, url, data, withCredentials, dataType, options;
-
- if (rails.fire(element, 'ajax:before')) {
- withCredentials = element.data('with-credentials') || null;
- dataType = element.data('type') || $.ajaxSettings && $.ajaxSettings.dataType;
-
- if (element.is('form')) {
- method = element.data('ujs:submit-button-formmethod') || element.attr('method');
- url = element.data('ujs:submit-button-formaction') || element.attr('action');
- data = $(element[0]).serializeArray(); // memoized value from clicked submit button
-
- var button = element.data('ujs:submit-button');
-
- if (button) {
- data.push(button);
- element.data('ujs:submit-button', null);
- }
-
- element.data('ujs:submit-button-formmethod', null);
- element.data('ujs:submit-button-formaction', null);
- } else if (element.is(rails.inputChangeSelector)) {
- method = element.data('method');
- url = element.data('url');
- data = element.serialize();
- if (element.data('params')) data = data + '&' + element.data('params');
- } else if (element.is(rails.buttonClickSelector)) {
- method = element.data('method') || 'get';
- url = element.data('url');
- data = element.serialize();
- if (element.data('params')) data = data + '&' + element.data('params');
- } else {
- method = element.data('method');
- url = rails.href(element);
- data = element.data('params') || null;
- }
-
- options = {
- type: method || 'GET',
- data: data,
- dataType: dataType,
- // stopping the "ajax:beforeSend" event will cancel the ajax request
- beforeSend: function beforeSend(xhr, settings) {
- if (settings.dataType === undefined) {
- xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
- }
-
- if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
- element.trigger('ajax:send', xhr);
- } else {
- return false;
- }
- },
- success: function success(data, status, xhr) {
- element.trigger('ajax:success', [data, status, xhr]);
- },
- complete: function complete(xhr, status) {
- element.trigger('ajax:complete', [xhr, status]);
- },
- error: function error(xhr, status, _error) {
- element.trigger('ajax:error', [xhr, status, _error]);
- },
- crossDomain: rails.isCrossDomain(url)
- }; // There is no withCredentials for IE6-8 when
- // "Enable native XMLHTTP support" is disabled
-
- if (withCredentials) {
- options.xhrFields = {
- withCredentials: withCredentials
- };
- } // Only pass url to `ajax` options if not blank
-
-
- if (url) {
- options.url = url;
- }
-
- return rails.ajax(options);
- } else {
- return false;
- }
- },
- // Determines if the request is a cross domain request.
- isCrossDomain: function isCrossDomain(url) {
- var originAnchor = document.createElement('a');
- originAnchor.href = location.href;
- var urlAnchor = document.createElement('a');
-
- try {
- urlAnchor.href = url; // This is a workaround to a IE bug.
-
- urlAnchor.href = urlAnchor.href; // If URL protocol is false or is a string containing a single colon
- // *and* host are false, assume it is not a cross-domain request
- // (should only be the case for IE7 and IE compatibility mode).
- // Otherwise, evaluate protocol and host of the URL against the origin
- // protocol and host.
-
- return !((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host || originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host);
- } catch (e) {
- // If there is an error parsing the URL, assume it is crossDomain.
- return true;
- }
- },
- // Handles "data-method" on links such as:
- //
Delete
- handleMethod: function handleMethod(link) {
- var href = rails.href(link),
- method = link.data('method'),
- target = link.attr('target'),
- csrfToken = rails.csrfToken(),
- csrfParam = rails.csrfParam(),
- form = $('
'),
- metadataInput = '
';
-
- if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) {
- metadataInput += '
';
- }
-
- if (target) {
- form.attr('target', target);
- }
-
- form.hide().append(metadataInput).appendTo('body');
- form.submit();
- },
- // Helper function that returns form elements that match the specified CSS selector
- // If form is actually a "form" element this will return associated elements outside the from that have
- // the html form attribute set
- formElements: function formElements(form, selector) {
- return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector);
- },
-
- /* Disables form elements:
- - Caches element value in 'ujs:enable-with' data store
- - Replaces element text with value of 'data-disable-with' attribute
- - Sets disabled property to true
- */
- disableFormElements: function disableFormElements(form) {
- rails.formElements(form, rails.disableSelector).each(function () {
- rails.disableFormElement($(this));
- });
- },
- disableFormElement: function disableFormElement(element) {
- var method, replacement;
- method = element.is('button') ? 'html' : 'val';
- replacement = element.data('disable-with');
-
- if (replacement !== undefined) {
- element.data('ujs:enable-with', element[method]());
- element[method](replacement);
- }
-
- element.prop('disabled', true);
- element.data('ujs:disabled', true);
- },
-
- /* Re-enables disabled form elements:
- - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
- - Sets disabled property to false
- */
- enableFormElements: function enableFormElements(form) {
- rails.formElements(form, rails.enableSelector).each(function () {
- rails.enableFormElement($(this));
- });
- },
- enableFormElement: function enableFormElement(element) {
- var method = element.is('button') ? 'html' : 'val';
-
- if (element.data('ujs:enable-with') !== undefined) {
- element[method](element.data('ujs:enable-with'));
- element.removeData('ujs:enable-with'); // clean up cache
- }
-
- element.prop('disabled', false);
- element.removeData('ujs:disabled');
- },
-
- /* For 'data-confirm' attribute:
- - Fires `confirm` event
- - Shows the confirmation dialog
- - Fires the `confirm:complete` event
- Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
- Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
- Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
- return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
- */
- allowAction: function allowAction(element) {
- var message = element.data('confirm'),
- answer = false,
- callback;
-
- if (!message) {
- return true;
- }
-
- if (rails.fire(element, 'confirm')) {
- try {
- answer = rails.confirm(message);
- } catch (e) {
- (console.error || console.log).call(console, e.stack || e);
- }
-
- callback = rails.fire(element, 'confirm:complete', [answer]);
- }
-
- return answer && callback;
- },
- // Helper function which checks for blank inputs in a form that match the specified CSS selector
- blankInputs: function blankInputs(form, specifiedSelector, nonBlank) {
- var foundInputs = $(),
- input,
- valueToCheck,
- radiosForNameWithNoneSelected,
- radioName,
- selector = specifiedSelector || 'input,textarea',
- requiredInputs = form.find(selector),
- checkedRadioButtonNames = {};
- requiredInputs.each(function () {
- input = $(this);
-
- if (input.is('input[type=radio]')) {
- // Don't count unchecked required radio as blank if other radio with same name is checked,
- // regardless of whether same-name radio input has required attribute or not. The spec
- // states https://www.w3.org/TR/html5/forms.html#the-required-attribute
- radioName = input.attr('name'); // Skip if we've already seen the radio with this name.
-
- if (!checkedRadioButtonNames[radioName]) {
- // If none checked
- if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) {
- radiosForNameWithNoneSelected = form.find('input[type=radio][name="' + radioName + '"]');
- foundInputs = foundInputs.add(radiosForNameWithNoneSelected);
- } // We only need to check each name once.
-
-
- checkedRadioButtonNames[radioName] = radioName;
- }
- } else {
- valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val();
-
- if (valueToCheck === nonBlank) {
- foundInputs = foundInputs.add(input);
- }
- }
- });
- return foundInputs.length ? foundInputs : false;
- },
- // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
- nonBlankInputs: function nonBlankInputs(form, specifiedSelector) {
- return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
- },
- // Helper function, needed to provide consistent behavior in IE
- stopEverything: function stopEverything(e) {
- $(e.target).trigger('ujs:everythingStopped');
- e.stopImmediatePropagation();
- return false;
- },
- // Replace element's html with the 'data-disable-with' after storing original html
- // and prevent clicking on it
- disableElement: function disableElement(element) {
- var replacement = element.data('disable-with');
-
- if (replacement !== undefined) {
- element.data('ujs:enable-with', element.html()); // store enabled state
-
- element.html(replacement);
- }
-
- element.on('click.railsDisable', function (e) {
- // prevent further clicking
- return rails.stopEverything(e);
- });
- element.data('ujs:disabled', true);
- },
- // Restore element to its original state which was disabled by 'disableElement' above
- enableElement: function enableElement(element) {
- if (element.data('ujs:enable-with') !== undefined) {
- element.html(element.data('ujs:enable-with')); // set to old enabled state
-
- element.removeData('ujs:enable-with'); // clean up cache
- }
-
- element.off('click.railsDisable'); // enable element
-
- element.removeData('ujs:disabled');
- }
- };
-
- if (rails.fire($document, 'rails:attachBindings')) {
- $.ajaxPrefilter(function (options, originalOptions, xhr) {
- if (!options.crossDomain) {
- rails.CSRFProtection(xhr);
- }
- }); // This event works the same as the load event, except that it fires every
- // time the page is loaded.
- //
- // See https://github.com/rails/jquery-ujs/issues/357
- // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
-
- $(window).on('pageshow.rails', function () {
- $($.rails.enableSelector).each(function () {
- var element = $(this);
-
- if (element.data('ujs:disabled')) {
- $.rails.enableFormElement(element);
- }
- });
- $($.rails.linkDisableSelector).each(function () {
- var element = $(this);
-
- if (element.data('ujs:disabled')) {
- $.rails.enableElement(element);
- }
- });
- });
- $document.on('ajax:complete', rails.linkDisableSelector, function () {
- rails.enableElement($(this));
- });
- $document.on('ajax:complete', rails.buttonDisableSelector, function () {
- rails.enableFormElement($(this));
- });
- $document.on('click.rails', rails.linkClickSelector, function (e) {
- var link = $(this),
- method = link.data('method'),
- data = link.data('params'),
- metaClick = e.metaKey || e.ctrlKey;
- if (!rails.allowAction(link)) return rails.stopEverything(e);
- if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link);
-
- if (rails.isRemote(link)) {
- if (metaClick && (!method || method === 'GET') && !data) {
- return true;
- }
-
- var handleRemote = rails.handleRemote(link); // Response from rails.handleRemote() will either be false or a deferred object promise.
-
- if (handleRemote === false) {
- rails.enableElement(link);
- } else {
- handleRemote.fail(function () {
- rails.enableElement(link);
- });
- }
-
- return false;
- } else if (method) {
- rails.handleMethod(link);
- return false;
- }
- });
- $document.on('click.rails', rails.buttonClickSelector, function (e) {
- var button = $(this);
- if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e);
- if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);
- var handleRemote = rails.handleRemote(button); // Response from rails.handleRemote() will either be false or a deferred object promise.
-
- if (handleRemote === false) {
- rails.enableFormElement(button);
- } else {
- handleRemote.fail(function () {
- rails.enableFormElement(button);
- });
- }
-
- return false;
- });
- $document.on('change.rails', rails.inputChangeSelector, function (e) {
- var link = $(this);
- if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e);
- rails.handleRemote(link);
- return false;
- });
- $document.on('submit.rails', rails.formSubmitSelector, function (e) {
- var form = $(this),
- remote = rails.isRemote(form),
- blankRequiredInputs,
- nonBlankFileInputs;
- if (!rails.allowAction(form)) return rails.stopEverything(e); // Skip other logic when required values are missing or file upload is present
-
- if (form.attr('novalidate') === undefined) {
- if (form.data('ujs:formnovalidate-button') === undefined) {
- blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false);
-
- if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
- return rails.stopEverything(e);
- }
- } else {
- // Clear the formnovalidate in case the next button click is not on a formnovalidate button
- // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain
- form.data('ujs:formnovalidate-button', undefined);
- }
- }
-
- if (remote) {
- nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
-
- if (nonBlankFileInputs) {
- // Slight timeout so that the submit button gets properly serialized
- // (make it easy for event handler to serialize form without disabled values)
- setTimeout(function () {
- rails.disableFormElements(form);
- }, 13);
- var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); // Re-enable form elements if event bindings return false (canceling normal form submission)
-
- if (!aborted) {
- setTimeout(function () {
- rails.enableFormElements(form);
- }, 13);
- }
-
- return aborted;
- }
-
- rails.handleRemote(form);
- return false;
- } else {
- // Slight timeout so that the submit button gets properly serialized
- setTimeout(function () {
- rails.disableFormElements(form);
- }, 13);
- }
- });
- $document.on('click.rails', rails.formInputClickSelector, function (event) {
- var button = $(this);
- if (!rails.allowAction(button)) return rails.stopEverything(event); // Register the pressed submit button
-
- var name = button.attr('name'),
- data = name ? {
- name: name,
- value: button.val()
- } : null;
- var form = button.closest('form');
-
- if (form.length === 0) {
- form = $('#' + button.attr('form'));
- }
-
- form.data('ujs:submit-button', data); // Save attributes from button
-
- form.data('ujs:formnovalidate-button', button.attr('formnovalidate'));
- form.data('ujs:submit-button-formaction', button.attr('formaction'));
- form.data('ujs:submit-button-formmethod', button.attr('formmethod'));
- });
- $document.on('ajax:send.rails', rails.formSubmitSelector, function (event) {
- if (this === event.target) rails.disableFormElements($(this));
- });
- $document.on('ajax:complete.rails', rails.formSubmitSelector, function (event) {
- if (this === event.target) rails.enableFormElements($(this));
- });
- $(function () {
- rails.refreshCSRFTokens();
- });
- }
- };
-
- if (window.jQuery) {
- jqueryUjsInit(jQuery);
- } else if (( false ? undefined : _typeof(exports)) === 'object' && ( false ? undefined : _typeof(module)) === 'object') {
- module.exports = jqueryUjsInit;
- }
-})();
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
-
-/***/ }),
-
-/***/ "./node_modules/jquery/dist/jquery.js":
-/*!********************************************!*\
- !*** ./node_modules/jquery/dist/jquery.js ***!
- \********************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-
-/*!
- * jQuery JavaScript Library v3.6.0
- * https://jquery.com/
- *
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright OpenJS Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2021-03-02T17:08Z
- */
-(function (global, factory) {
- "use strict";
-
- if (( false ? undefined : _typeof(module)) === "object" && _typeof(module.exports) === "object") {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ? factory(global, true) : function (w) {
- if (!w.document) {
- throw new Error("jQuery requires a window with a document");
- }
-
- return factory(w);
- };
- } else {
- factory(global);
- } // Pass this if window is not defined yet
-
-})(typeof window !== "undefined" ? window : this, function (window, noGlobal) {
- // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
- // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
- // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
- // enough that all such attempts are guarded in a try block.
- "use strict";
-
- var arr = [];
- var getProto = Object.getPrototypeOf;
- var _slice = arr.slice;
- var flat = arr.flat ? function (array) {
- return arr.flat.call(array);
- } : function (array) {
- return arr.concat.apply([], array);
- };
- var push = arr.push;
- var indexOf = arr.indexOf;
- var class2type = {};
- var toString = class2type.toString;
- var hasOwn = class2type.hasOwnProperty;
- var fnToString = hasOwn.toString;
- var ObjectFunctionString = fnToString.call(Object);
- var support = {};
-
- var isFunction = function isFunction(obj) {
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML