Untitled

 avatar
unknown
plain_text
5 months ago
847 B
3
Indexable
$(".others").each(function() {
    const step = $(this).attr("step");
    const thisId = $(this).attr('id');
    
    // Tạo mapping object để map điều kiện với id fieldset
    const stepFieldsetMap = {
        '2': 'common-fieldset',
        '4': {
            'common': 'common-fieldset',
            'default': 'flash-settings-fieldset'
        }
    };

    let selector = `.fieldset fieldset[step='${step}']`;
    
    // Nếu có nhiều fieldset cùng step, xác định fieldset cụ thể
    if ($(selector).length > 1) {
        const fieldsetId = step === '4' 
            ? stepFieldsetMap['4'][thisId] || stepFieldsetMap['4'].default
            : stepFieldsetMap[step];
            
        if (fieldsetId) {
            selector += `[id='${fieldsetId}']`;
        }
    }
    
    $(this).html($(selector).html());
});
Editor is loading...
Leave a Comment