Slide duration set to 200ms for multiselect (same duration as user menu)

This commit is contained in:
unknown 2013-12-05 15:46:13 -05:00
parent ec0aa6bb65
commit 853373348c
1 changed files with 7 additions and 6 deletions

View File

@ -27,6 +27,7 @@
'onuncheck':false, 'onuncheck':false,
'minWidth': 'default;' 'minWidth': 'default;'
}; };
var slideDuration = 200;
$(this).attr('data-msid', multiSelectId); $(this).attr('data-msid', multiSelectId);
$.extend(settings,options); $.extend(settings,options);
$.each(this.children(),function(i,option) { $.each(this.children(),function(i,option) {
@ -68,12 +69,12 @@
var button=$(this); var button=$(this);
if(button.parent().children('ul').length>0) { if(button.parent().children('ul').length>0) {
if(self.menuDirection === 'down') { if(self.menuDirection === 'down') {
button.parent().children('ul').slideUp(400,function() { button.parent().children('ul').slideUp(slideDuration,function() {
button.parent().children('ul').remove(); button.parent().children('ul').remove();
button.removeClass('active down'); button.removeClass('active down');
}); });
} else { } else {
button.parent().children('ul').fadeOut(400,function() { button.parent().children('ul').fadeOut(slideDuration,function() {
button.parent().children('ul').remove(); button.parent().children('ul').remove();
button.removeClass('active up'); button.removeClass('active up');
}); });
@ -81,7 +82,7 @@
return; return;
} }
var lists=$('ul.multiselectoptions'); var lists=$('ul.multiselectoptions');
lists.slideUp(400,function(){ lists.slideUp(slideDuration,function(){
lists.remove(); lists.remove();
$('div.multiselect').removeClass('active'); $('div.multiselect').removeClass('active');
button.addClass('active'); button.addClass('active');
@ -276,7 +277,7 @@
}); });
list.addClass('down'); list.addClass('down');
button.addClass('down'); button.addClass('down');
list.slideDown(); list.slideDown(slideDuration);
} else { } else {
list.css('max-height', $(document).height()-($(document).height()-(pos.top)+50)+'px'); list.css('max-height', $(document).height()-($(document).height()-(pos.top)+50)+'px');
list.css({ list.css({
@ -299,12 +300,12 @@
if(!button.parent().data('preventHide')) { if(!button.parent().data('preventHide')) {
// How can I save the effect in a var? // How can I save the effect in a var?
if(self.menuDirection === 'down') { if(self.menuDirection === 'down') {
button.parent().children('ul').slideUp(400,function() { button.parent().children('ul').slideUp(slideDuration,function() {
button.parent().children('ul').remove(); button.parent().children('ul').remove();
button.removeClass('active down'); button.removeClass('active down');
}); });
} else { } else {
button.parent().children('ul').fadeOut(400,function() { button.parent().children('ul').fadeOut(slideDuration,function() {
button.parent().children('ul').remove(); button.parent().children('ul').remove();
button.removeClass('active up'); button.removeClass('active up');
}); });