Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Prevent first option topOptionText from being clickable #14

Open
@amazingBytes

Description

@amazingBytes

To prevent the first option from being clickable I'd like to suggest the following addition of a function and a slightly change of code.

New function:

//function to create first option in the select menu
function createFirstOption($container){

        $('<option selected="selected" disabled="disabled" value="0">'+settings.topOptionText+'</option>').appendTo($container);
}//createFirstOption()

Within the function createSelect() use instead of

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createOption($('<li>'+settings.topOptionText+'</li>'), $select);
    }

the code

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createFirstOption($select);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions