PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/hotebooking.site/wp-content/themes/traveler/v3/js/admin/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/hotebooking.site/wp-content/themes/traveler/v3/js/admin/menu-admin.js

;(function ($) {
    'use strict';

    let TRAVELER_MEGA_MENU_ITEM = {
        init: function () {
            let base = this;
            base.megaMenuFunc();
        },
        megaMenuFunc: function () {

            $(".st-color-field").wpColorPicker();
            $("#menu-to-edit").on("click", ".item-edit", function (e) {
                var t = $(this).closest(".menu-item").find(".st-color-field");
                t.hasClass("wp-color-field") || t.wpColorPicker();
            });

            $(".remove_image_button").each(function () {
                "" != $(this).parent().find(".image_attachment_id").val() && $(this).show();
            });
            $("#menu-to-edit").on("click", ".remove_image_button", function (e) {
                $(this).parent().find(".image-preview").remove();
                $(this).parent().find(".image_attachment_id").val("");
                $(this).hide();
            });
            if ($("body").hasClass("nav-menus-php")) {
                $("#menu-to-edit").on("click", ".upload_image_button", function (e) {
                    e.preventDefault();
                    let $this = $(this);
                    let media = wp.media({multiple: !1}).open().on("select", function (e) {
                        let t = media.state().get("selection").first().toJSON();
                        $this.parent().find(".image-preview-wrapper").html('<img style="max-width:100%" class="image-preview" src="' + t.url + '" />');
                        $this.parent().find(".image_attachment_id").val(t.id);
                        $this.parent().find(".remove_image_button").show();
                    });
                });
            }
        }
    };

    TRAVELER_MEGA_MENU_ITEM.init();
    $(document).on('menu-item-added', function (ev, $menuMarkup) {
        TRAVELER_MEGA_MENU_ITEM.init();
    });

})(jQuery)