|
1381 | 1381 | // set the scroll of the checkbox container
|
1382 | 1382 | this.$checkboxes.scrollTop(0);
|
1383 | 1383 |
|
1384 |
| - // show the menu, maybe with a speed/effect combo |
| 1384 | + // Show the menu, set its dimensions, and position it. |
| 1385 | + $menu.css('display','block'); |
| 1386 | + this._setMenuWidth(); |
| 1387 | + this._setMenuHeight(); |
| 1388 | + this.position(); |
| 1389 | + |
| 1390 | + // Do any specified open animation effect after positioning the menu. |
1385 | 1391 | if (!!effect) {
|
| 1392 | + // Menu must be hidden for some effects (e.g. fade) to work. |
| 1393 | + $menu.css('display','none'); |
1386 | 1394 | if (typeof effect == 'string') {
|
1387 |
| - $.fn.show.call($menu, effect, this.speed); |
| 1395 | + $menu.show(effect, this.speed); |
1388 | 1396 | }
|
1389 | 1397 | else if (typeof effect == 'object' && effect.constructor == Array) {
|
1390 |
| - $.fn.show.call($menu, effect[0], effect[1] || this.speed); |
| 1398 | + $menu.show(effect[0], effect[1] || this.speed); |
1391 | 1399 | }
|
1392 | 1400 | else if (typeof effect == 'object' && effect.constructor == Object) {
|
1393 |
| - $.fn.show.call($menu, effect); |
| 1401 | + $menu.show(effect); |
1394 | 1402 | }
|
1395 | 1403 | }
|
1396 |
| - else { |
1397 |
| - $menu.css('display','block'); |
1398 |
| - } |
1399 |
| - |
1400 |
| - this._setMenuWidth(); |
1401 |
| - this._setMenuHeight(); |
1402 |
| - this.position(); |
1403 | 1404 |
|
1404 | 1405 | // focus the first not disabled option or filter input if available
|
1405 | 1406 | var filter = $header.find(".ui-multiselect-filter");
|
|
1439 | 1440 | // hide the menu, maybe with a speed/effect combo
|
1440 | 1441 | if (!!effect) {
|
1441 | 1442 | if (typeof effect == 'string') {
|
1442 |
| - $.fn.hide.call($menu, effect, this.speed); |
| 1443 | + $menu.hide(effect, this.speed); |
1443 | 1444 | }
|
1444 | 1445 | else if (typeof effect == 'object' && effect.constructor == Array) {
|
1445 |
| - $.fn.hide.call($menu, effect[0], effect[1] || this.speed); |
| 1446 | + $menu.hide(effect[0], effect[1] || this.speed); |
1446 | 1447 | }
|
1447 | 1448 | else if (typeof effect == 'object' && effect.constructor == Object) {
|
1448 |
| - $.fn.hide.call($menu, effect); |
| 1449 | + $menu.hide(effect); |
1449 | 1450 | }
|
1450 | 1451 | }
|
1451 | 1452 | else {
|
1452 | 1453 | $menu.css('display','none');
|
1453 | 1454 | }
|
1454 | 1455 |
|
1455 | 1456 | $button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave');
|
| 1457 | + this.element.trigger('blur'); // For jQuery Validate |
1456 | 1458 | this._isOpen = false;
|
1457 | 1459 | this._trigger('close');
|
1458 | 1460 | $button.trigger('focus');
|
|
0 commit comments