We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I do some changes in this function:
$.fn.material_select = function () { $(this).each(function(){ $select = $(this); if ( $select.hasClass('browser-default') || $select.hasClass('initialized')) { var span = $select.parent().children('span'); var uniqueID = span.attr('data-activates'); var options = $('#' + uniqueID); options.empty(); //return; // Continue to next (return false breaks out of entire loop) }else{ var uniqueID = 'select-options-'+guid(); var options = $('<ul id="' + uniqueID+'" class="dropdown-content select-dropdown"></ul>'); var wrapper = $('<div class="select-wrapper"></div>'); } var selectOptions = $select.children('option'); if ($select.find('option:selected') !== undefined) { var label = $select.find('option:selected'); } else { var label = options.first(); } // Create Dropdown structure selectOptions.each(function () { // Add disabled attr if disabled options.append($('<li class="' + (($(this).is(':disabled')) ? 'disabled' : '') + '"><span>' + $(this).html() + '</span></li>')); }); options.find('li').each(function (i) { var $curr_select = $select; $(this).click(function () { // Check if option element is disabled if (!$(this).hasClass('disabled')) { $curr_select.find('option').eq(i).prop('selected', true); // Trigger onchange() event if (typeof($curr_select.context.onchange) === "function") { $curr_select[0].onchange(); } $curr_select.prev('span.select-dropdown').html($(this).text()); } }); }); if ( $select.hasClass('browser-default') || $select.hasClass('initialized')) { span.html(label.html()); }else{ // Wrap Elements $select.wrap(wrapper); // Add Select Display Element var $newSelect = $('<span class="select-dropdown ' + (($select.is(':disabled')) ? 'disabled' : '') + '" data-activates="' + uniqueID +'">' + label.html() + '</span>'); $select.before($newSelect); $('body').append(options); // Check if section element is disabled if (!$select.is(':disabled')) { $newSelect.dropdown({"hover": false}); } $select.addClass('initialized'); } }); };
The text was updated successfully, but these errors were encountered:
Maybe you should create pull request for it? At least diff with highlighted changes will be more useful ;)
Sorry, something went wrong.
This seems to be relevant to issue #452 A pull request would definitely be appreciated.
duplicate of #452
No branches or pull requests
I do some changes in this function:
The text was updated successfully, but these errors were encountered: