This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).click(function(e) { | |
if ($(e.target).closest('.toggle').length > 0){ | |
e.preventDefault(); | |
var target = target.closest('.toggle'); | |
if (target.hasClass('menuOn')){ | |
$('.toggle').removeClass('menuOn'); | |
target.closest('.dropdown').find('.menu').hide('fast'); | |
} else { | |
$('.toggle').removeClass('menuOn'); | |
$('.dropdown .menu').hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `gem list --no-versions`; do gem uninstall -Ia $i; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#ms-YOUR_SELECT_ID .ms-selectable').find('li.ms-elem-selectable').hide(); | |
$('.ms-optgroup-label').click(function(){ | |
$(this).nextAll('li').toggle(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#searchable-form').multiSelect({ | |
selectableHeader : '<input type="text" id="search" />' | |
}); | |
$('input#search').quicksearch('#ms-searchable-form .ms-selectable li'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.multiselect').multiSelect({ | |
afterSelect: function(value){ | |
if (1 == 1){ | |
var selectedLi = $('.ms-elem-selected[ms-value="'+value+'"]').first(); | |
selectedLi.unbind('click'); | |
selectedLi.addClass('beautiful-disabled-class'); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#searchable-form').multiSelect({ | |
selectableHeader : '<input type="text" id="search" autocomplete = "off" />' | |
}); | |
$('input#search').quicksearch('#ms-searchable-form .ms-selectable li'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<select name="countries[]" multiple="multiple" id="searchable-select"> | |
<option value="fr" selected="selected">France</option> | |
<option value="ca">Canada</option> | |
<option value="ar">Argentina</option> | |
<option value="pt">Portugal</option> | |
<option value="us">United States</option> | |
<option value="gb">United Kingdom</option> | |
<option value="au">Australia</option> | |
<option value="ao">Angola</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#countries').multiSelect({ | |
afterSelect: function(value, text){}, // Function to call after one item is selected | |
afterDeselect: function(value, text){}, // Function to call after one item is deselected | |
selectableHeader: null, // Text or HTML to display on the selectable container | |
selectedHeader: null, // Text or HTML to display on the selected container | |
disabledClass: 'disabled' // CSS class for disabled items | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select multiple="multiple" id="countries" name="countries[]"> | |
<option value="fr">France</option> | |
<option value="uk">United Kingdom</option> | |
<option value="us">United States</option> | |
<option value="ch">China</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must init the multiple select with $('#my-select').multiSelect() before calling one of the following methods | |
$('#countries').multiSelect('select', 'value'); // Select the item with the value given in parameter | |
$('#countries').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter | |
$('#countries').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items. | |
$('#countries').multiSelect('deselect_all'); // Deselect all items previously selected |
OlderNewer