%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/templates/UB/components/UB/user.profile/.default/
Upload File :
Create Path :
Current File : //home/bitrix/www/bitrix/templates/UB/components/UB/user.profile/.default/script.js

BX.ready(function(){
    $("select.form-control").chosen();
    $("#type259").change(function () {
        if ($(this).prop("checked")){
            if ($("#type260").prop("checked")) {
                $("#type260").prop("checked", false);
                $("#type260").removeAttr("checked");
            }
        } else {
            $(this).prop("checked",true);
        };
    });
    $("#type260").change(function () {
        if ($(this).prop("checked")){
            if ($("#type259").prop("checked")) {
                $("#type259").prop("checked", false);
                $("#type259").removeAttr("checked");
            }
        } else {
            $(this).prop("checked",true);
        };
    });
    var objSize = {};
    var objShoes = {};
    var unitsys = ["RU","UK","US","EU"];
    for (var j=0; j<unitsys.length; j++){
        objSize[unitsys[j]] = {};
        objShoes[unitsys[j]] = {};
    };

    $("select[name='SIZE'] option").each(function(){
        if ($(this).attr("class") !== "null"){
            objSize[$(this).attr("class")][$(this).attr("data-size")+" "] = $(this).val();
        }
    });
    $("select[name='SHOES'] option").each(function(){
        if ($(this).attr("class") !== "null"){
            objShoes[$(this).attr("class")][$(this).attr("data-size")+" "] = $(this).val();
        }
    });
    function compareNumeric(a, b) {
        if (a > b) return 1;
        if (a < b) return -1;
    }


    /*
     objSize["RU"].sort(compareNumeric);
     objSize["UK"].sort(compareNumeric);
     objSize["US"].sort(compareNumeric);
     objSize["EU"].sort(compareNumeric);
     objShoes["RU"].sort(compareNumeric);
     objShoes["UK"].sort(compareNumeric);
     objShoes["US"].sort(compareNumeric);
     objShoes["EU"].sort(compareNumeric);*/
    /*$("select[name='SIZE'] option").each(function(){
     if ($(this).attr("class") !== "null" && $(this).attr("class") !== $("#MODUNSIZE .chosen-container .chosen-single span").text()) {
     $(this).remove();
     };
     });*/
    $("#SELTSIZE .chosen-container").click(function(){
        $(this).find(".chosen-drop").find(".chosen-results").find("li").each(function(){
            if (!$(this).hasClass($("#MODUNSIZE .chosen-container .chosen-single span").text()) && !$(this).hasClass("null")){
                $(this).hide();
            }
        });
    });
    $("#SELTSHOES .chosen-container").click(function(){
        $(this).find(".chosen-drop").find(".chosen-results").find("li").each(function(){
            if (!$(this).hasClass($("#MODUNSHOES .chosen-container .chosen-single span").text()) && !$(this).hasClass("null")){
                $(this).hide();
            }
        });
    });

    /*$("select[name='SHOES'] option").each(function(){
     if ($(this).attr("class") !== "null" && $(this).attr("class") !== $("#MODUNSHOES .chosen-container .chosen-single span").text()) {
     $(this).remove();
     };
     });*/
    $("select[name='SIZETYPE']").change(function(){
        $("select[name='SIZE'] :first").attr("selected","selected");
        $("#SELTSIZE .chosen-container .chosen-drop .chosen-results li").each(function(){
            if ($(this).hasClass("result-selected") && !$(this).hasClass("null")){
                $(this).removeClass("result-selected");
            };

        });
        $("#SELTSIZE .chosen-container .chosen-drop .chosen-results .null").addClass("result-selected");
        $("#SELTSIZE .chosen-container .chosen-single span").text("...");
    });
    $("select[name='SHOESTYPE']").change(function(){
        $("select[name='SHOES'] :first").attr("selected","selected");
        $("#SELTSHOES .chosen-container .chosen-drop .chosen-results li").each(function(){
            if ($(this).hasClass("result-selected") && !$(this).hasClass("null")){
                $(this).removeClass("result-selected");
            };

        });
        $("#SELTSHOES .chosen-container .chosen-drop .chosen-results .null").addClass("result-selected");
        $("#SELTSHOES .chosen-container .chosen-single span").text("...");
    });
});

Zerion Mini Shell 1.0