Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for update #102

Closed
rhianmolinari opened this issue Feb 27, 2013 · 0 comments
Closed

Suggestion for update #102

rhianmolinari opened this issue Feb 27, 2013 · 0 comments

Comments

@rhianmolinari
Copy link

The list can remove the class.

Before:

// HTML template for dropdown options
optionTemplate = '<li class="{{ value }}"><a data-dk-dropdown-value="{{ value }}">{{ text }}</a></li>';

After:

// HTML template for dropdown options
optionTemplate = '<li><a data-dk-dropdown-value="{{ value }}">{{ text }}</a></li>';

That makes the <li> do not get the empty class.

This amendment is to remove the attribute, it will not let the

  • with empty class when another item is selected from the dropdown.

    Before:

    // Set the currently selected option
    function _setCurrent($current, $dk) {
        $dk.find('.dk_option_current').removeClass('dk_option_current');
        $current.addClass('dk_option_current');
        _setScrollPos($dk, $current);
    }

    After:

    // Set the currently selected option
    function _setCurrent($current, $dk) {
        $dk.find('.dk_option_current').removeAttr('class');
        $current.addClass('dk_option_current');
        _setScrollPos($dk, $current);
    }

    Another suggestion is if the <select> when it is necessary to direct a url to do something similar to javascript below. It is widely used in archive (dropdown) of Wordpress.

    $(document).ready(function(){
                $('#archive_dropdown').dropkick({
                    change: function (value, label) {
                        location.href = value;
                    }
                });
    });

    Hope that helps improve the plugin!

    www.rhianmolinari.com

  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants