Browse Source

Fix loading dropdown button, duplicate loading state, similar #2295. Fix search inside menu does not clear search term on select

pull/2300/head
jlukic 9 years ago
parent
commit
1a5010b36e
2 changed files with 9 additions and 2 deletions
  1. 5
      src/definitions/modules/dropdown.js
  2. 6
      src/definitions/modules/dropdown.less

5
src/definitions/modules/dropdown.js

@ -1722,6 +1722,8 @@ $.fn.dropdown = function(parameters) {
scrollPage: function(direction, $selectedItem) { scrollPage: function(direction, $selectedItem) {
var var
$selectedItem = $selectedItem || module.get.selectedItem(),
$menu = $selectedItem.closest(selector.menu),
menuHeight = $menu.outerHeight(), menuHeight = $menu.outerHeight(),
currentScroll = $menu.scrollTop(), currentScroll = $menu.scrollTop(),
itemHeight = $item.eq(0).outerHeight(), itemHeight = $item.eq(0).outerHeight(),
@ -1735,7 +1737,6 @@ $.fn.dropdown = function(parameters) {
$nextSelectedItem, $nextSelectedItem,
elementIndex elementIndex
; ;
$selectedItem = $selectedItem || module.get.selectedItem();
elementIndex = (direction == 'up') elementIndex = (direction == 'up')
? $selectableItem.index($selectedItem) - itemsPerPage ? $selectableItem.index($selectedItem) - itemsPerPage
: $selectableItem.index($selectedItem) + itemsPerPage : $selectableItem.index($selectedItem) + itemsPerPage
@ -2618,7 +2619,7 @@ $.fn.dropdown = function(parameters) {
}, },
hideAndClear: function() { hideAndClear: function() {
if(module.is.searchSelection()) {
if(module.has.search()) {
module.remove.searchTerm(); module.remove.searchTerm();
module.hide(function() { module.hide(function() {
module.remove.filteredItem(); module.remove.filteredItem();

6
src/definitions/modules/dropdown.less

@ -781,6 +781,12 @@ select.ui.dropdown {
border-width: @loaderLineWidth; border-width: @loaderLineWidth;
} }
/* Coupling */
.ui.loading.dropdown.button > i.icon:before,
.ui.loading.dropdown.button > i.icon:after {
display: none;
}
@keyframes dropdown-spin { @keyframes dropdown-spin {
from { from {
transform: rotate(0deg); transform: rotate(0deg);

Loading…
Cancel
Save