Files
wordpress-theme-aksrt/assets/js/runtime/page-navs.js
T
2026-08-25 20:15:55 +08:00

47 lines
1.5 KiB
JavaScript

//文章导航
jQuery("button[evt='action']").on("click", function (t) {
t = t || window.event;
var a = t.target || t.srcElement,
e = jQuery(a),
n = e.parents("form"),
r = n.serializeObject(),
c = [];
return jQuery("#cat-sortable-ok .sortable-cat-item").each(function () {
c.push(jQuery(this).attr("data-id"));
}), r.navs_show_cat_id = c, save_userdata(r, aksrt__("save_success"), "reload"), !1;
});
function save_userdata(b, c, d) {
notyf(aksrt__("processing_wait"), "load", "", "user_ajax"),
c = c || aksrt__("done");
jQuery.ajax({
type: "POST",
url: _win.uri + '/action/post_navs.php',
data: b,
dataType: "json",
success: function (n) {
if (n.error) {
n.msg && notyf(n.msg, (n.error ? 'danger' : ""), "", "user_ajax");
} else {
notyf(n.msg || c, "", "", "user_ajax");
"reload" == d && location.reload();
}
}
});
}
jQuery(document).ready(function () {
jQuery("#cat-sortable").length && tbquire(["sortablejs"], function () {
var e = document.getElementById("cat-sortable"),
t = document.getElementById("cat-sortable-ok"),
a = {
group: "cat_shared",
multiDrag: !0,
chosenClass: "chosen",
fallbackClass: !0,
animation: 400
};
Sortable.create(e, a), Sortable.create(t, a);
});
});