How to use the sortablejs.utils function in sortablejs

To help you get started, we’ve selected a few sortablejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gchq / CyberChef / src / web / RecipeWaiter.js View on Github external
dataTransfer.setData("Text", dragEl.querySelector(".arg-title").textContent);
        },
        onEnd: function(evt) {
            if (this.removeIntent) {
                evt.item.remove();
                evt.target.dispatchEvent(this.manager.operationremove);
            }
        }.bind(this),
        onSort: function(evt) {
            if (evt.from.id === "rec-list") {
                document.dispatchEvent(this.manager.statechange);
            }
        }.bind(this)
    });

    Sortable.utils.on(recList, "dragover", function() {
        this.removeIntent = false;
    }.bind(this));

    Sortable.utils.on(recList, "dragleave", function() {
        this.removeIntent = true;
        this.app.progress = 0;
    }.bind(this));

    Sortable.utils.on(recList, "touchend", function(e) {
        const loc = e.changedTouches[0];
        const target = document.elementFromPoint(loc.clientX, loc.clientY);

        this.removeIntent = !recList.contains(target);
    }.bind(this));

    // Favourites category
github gchq / CyberChef / src / web / RecipeWaiter.js View on Github external
if (evt.from.id === "rec-list") {
                document.dispatchEvent(this.manager.statechange);
            }
        }.bind(this)
    });

    Sortable.utils.on(recList, "dragover", function() {
        this.removeIntent = false;
    }.bind(this));

    Sortable.utils.on(recList, "dragleave", function() {
        this.removeIntent = true;
        this.app.progress = 0;
    }.bind(this));

    Sortable.utils.on(recList, "touchend", function(e) {
        const loc = e.changedTouches[0];
        const target = document.elementFromPoint(loc.clientX, loc.clientY);

        this.removeIntent = !recList.contains(target);
    }.bind(this));

    // Favourites category
    document.querySelector("#categories a").addEventListener("dragover", this.favDragover.bind(this));
    document.querySelector("#categories a").addEventListener("dragleave", this.favDragleave.bind(this));
    document.querySelector("#categories a").addEventListener("drop", this.favDrop.bind(this));
};
github eriklieben / aurelia-sortablejs / src / sortable.ts View on Github external
private attachListeners() {
    Sortable.utils.on(this.element, "add", event => this.dispatch("sortable-add", event));
    Sortable.utils.on(this.element, "choose", event => this.dispatch("sortable-choose", event));
    Sortable.utils.on(this.element, "end", event => this.dispatch("sortable-end", event));
    Sortable.utils.on(this.element, "filter", event => this.dispatch("sortable-filter", event));
    Sortable.utils.on(this.element, "move", event => this.dispatch("sortable-move", event));
    Sortable.utils.on(this.element, "remove", event => this.dispatch("sortable-remove", event));
    Sortable.utils.on(this.element, "sort", event => this.dispatch("sortable-sort", event));
    Sortable.utils.on(this.element, "start", event => this.dispatch("sortable-start", event));
    Sortable.utils.on(this.element, "update", event => this.dispatch("sortable-update", event));
  }
github gchq / CyberChef / src / web / OperationsWaiter.js View on Github external
el.parentNode.removeChild(el);
            }
        },
        onEnd: function(evt) {
            if (this.removeIntent) {
                $(evt.item).popover("destroy");
                evt.item.remove();
            }
        }.bind(this),
    });

    Sortable.utils.on(editFavouritesList, "dragleave", function() {
        this.removeIntent = true;
    }.bind(this));

    Sortable.utils.on(editFavouritesList, "dragover", function() {
        this.removeIntent = false;
    }.bind(this));

    $("#edit-favourites-list [data-toggle=popover]").popover();
    $("#favourites-modal").modal();
};
github gchq / CyberChef / src / web / OperationsWaiter.js View on Github external
onFilter: function (evt) {
            const el = editableList.closest(evt.item);
            if (el && el.parentNode) {
                $(el).popover("destroy");
                el.parentNode.removeChild(el);
            }
        },
        onEnd: function(evt) {
            if (this.removeIntent) {
                $(evt.item).popover("destroy");
                evt.item.remove();
            }
        }.bind(this),
    });

    Sortable.utils.on(editFavouritesList, "dragleave", function() {
        this.removeIntent = true;
    }.bind(this));

    Sortable.utils.on(editFavouritesList, "dragover", function() {
        this.removeIntent = false;
    }.bind(this));

    $("#edit-favourites-list [data-toggle=popover]").popover();
    $("#favourites-modal").modal();
};
github eriklieben / aurelia-sortablejs / src / sortable.ts View on Github external
private attachListeners() {
    Sortable.utils.on(this.element, "add", event => this.dispatch("sortable-add", event));
    Sortable.utils.on(this.element, "choose", event => this.dispatch("sortable-choose", event));
    Sortable.utils.on(this.element, "end", event => this.dispatch("sortable-end", event));
    Sortable.utils.on(this.element, "filter", event => this.dispatch("sortable-filter", event));
    Sortable.utils.on(this.element, "move", event => this.dispatch("sortable-move", event));
    Sortable.utils.on(this.element, "remove", event => this.dispatch("sortable-remove", event));
    Sortable.utils.on(this.element, "sort", event => this.dispatch("sortable-sort", event));
    Sortable.utils.on(this.element, "start", event => this.dispatch("sortable-start", event));
    Sortable.utils.on(this.element, "update", event => this.dispatch("sortable-update", event));
  }
github eriklieben / aurelia-sortablejs / dist / commonjs / sortable.js View on Github external
SortableCustomAttribute.prototype.attachListeners = function () {
        var _this = this;
        Sortable.utils.on(this.element, "add", function (event) { return _this.dispatch("sortable-add", event); });
        Sortable.utils.on(this.element, "choose", function (event) { return _this.dispatch("sortable-choose", event); });
        Sortable.utils.on(this.element, "end", function (event) { return _this.dispatch("sortable-end", event); });
        Sortable.utils.on(this.element, "filter", function (event) { return _this.dispatch("sortable-filter", event); });
        Sortable.utils.on(this.element, "move", function (event) { return _this.dispatch("sortable-move", event); });
        Sortable.utils.on(this.element, "remove", function (event) { return _this.dispatch("sortable-remove", event); });
        Sortable.utils.on(this.element, "sort", function (event) { return _this.dispatch("sortable-sort", event); });
        Sortable.utils.on(this.element, "start", function (event) { return _this.dispatch("sortable-start", event); });
        Sortable.utils.on(this.element, "update", function (event) { return _this.dispatch("sortable-update", event); });
    };
    SortableCustomAttribute.prototype.dispatch = function (name, data) {
github eriklieben / aurelia-sortablejs / dist / commonjs / sortable.js View on Github external
SortableCustomAttribute.prototype.attachListeners = function () {
        var _this = this;
        Sortable.utils.on(this.element, "add", function (event) { return _this.dispatch("sortable-add", event); });
        Sortable.utils.on(this.element, "choose", function (event) { return _this.dispatch("sortable-choose", event); });
        Sortable.utils.on(this.element, "end", function (event) { return _this.dispatch("sortable-end", event); });
        Sortable.utils.on(this.element, "filter", function (event) { return _this.dispatch("sortable-filter", event); });
        Sortable.utils.on(this.element, "move", function (event) { return _this.dispatch("sortable-move", event); });
        Sortable.utils.on(this.element, "remove", function (event) { return _this.dispatch("sortable-remove", event); });
        Sortable.utils.on(this.element, "sort", function (event) { return _this.dispatch("sortable-sort", event); });
        Sortable.utils.on(this.element, "start", function (event) { return _this.dispatch("sortable-start", event); });
        Sortable.utils.on(this.element, "update", function (event) { return _this.dispatch("sortable-update", event); });
    };
    SortableCustomAttribute.prototype.dispatch = function (name, data) {

sortablejs

JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap.

MIT
Latest version published 2 months ago

Package Health Score

88 / 100
Full package analysis