?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/schtroumpf.fr/modules/an_homeslider/views/js/



?? Go up: /home/webdevt/www/schtroumpf.fr/modules/an_homeslider/views

?? Viewing: sorting.js

/**
 * 2022 Anvanto
 *
 * NOTICE OF LICENSE
 *
 * This file is not open source! Each license that you purchased is only available for 1 wesite only.
 * If you want to use this file on more websites (or projects), you need to purchase additional licenses. 
 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
 *
 *  @author Anvanto <anvantoco@gmail.com>
 *  @copyright  2022 Anvanto
 *  @license    Valid for 1 website (or project) for each purchase of license
 *  International Registered Trademark & Property of Anvanto
 */

! function(t) {
    "use strict";
    var n = t.when(),
        e = "undefined" != typeof baseAdminDir ? location.origin + baseAdminDir + currentIndex + "&token=" + token : location.href,
        o = e + "&ajax";
    t(document).ready(function() {
        var e = t("#table-slide tbody")[0];
        return "undefined" != typeof e && void new Sortable(e, {
            group: "name",
            sort: !0,
            handle: '.handle',
            delay: 0,
            disabled: !1,
            draggable: "tr",
            store: null,
            animation: 150,
            setData: function(t, n) {
                t.setData("Text", n.textContent)
            },
            onStart: function(t) {},
            onEnd: function(t) {},
            onSort: function(e) {
                n = n.then(function() {
                    return t.post(o, {
                        action: "updatePositions",
                        positions: t("#table-slide tbody tr").toArray().map(function(n) {
                            return parseInt(t(n).children("td").eq(1).html()) || 0
                        })
                    })
                }).then(function(n) {
                    var e = 1;
                    n.success ? (t("#table-slide tbody tr").each(function() {
                        t(t(this).children("td")[4]).find('span').html(e++)
                    }), showSuccessMessage(n.message)) : showErrorMessage(n.message)
                })
            }
        })
    })
}(jQuery);


??

??