diff --git a/dist/select.css b/dist/select.css index fe2b1da3b..21d789ca0 100644 --- a/dist/select.css +++ b/dist/select.css @@ -260,3 +260,7 @@ body > .ui-select-bootstrap.open { .ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown { box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25); } +.ui-select-choices .no-result{ + color: #aaa; +} + diff --git a/dist/select.js b/dist/select.js index 8ba040885..52642b3f5 100644 --- a/dist/select.js +++ b/dist/select.js @@ -1029,7 +1029,11 @@ uis.directive('uiSelect', var offsetDropdown = uisOffset(dropdown); // Determine if the direction of the dropdown needs to be changed. - if (offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight) { + var _scrollTop = $document[0].documentElement.scrollTop; + if(_scrollTop === 0){ + _scrollTop = angular.element("body")[0].scrollTop; + } + if (offset.top + offset.height + offsetDropdown.height > _scrollTop + $document[0].documentElement.clientHeight) { dropdown[0].style.position = 'absolute'; dropdown[0].style.top = (offsetDropdown.height * -1) + 'px'; element.addClass(directionUpClassName); @@ -1806,11 +1810,11 @@ $templateCache.put("bootstrap/match-multiple.tpl.html","{{$select.placeholder}} "); $templateCache.put("bootstrap/select-multiple.tpl.html","
"); $templateCache.put("bootstrap/select.tpl.html","
"); -$templateCache.put("select2/choices.tpl.html",""); +$templateCache.put("select2/choices.tpl.html",""); $templateCache.put("select2/match-multiple.tpl.html","
  • "); $templateCache.put("select2/match.tpl.html","{{$select.placeholder}} "); $templateCache.put("select2/select-multiple.tpl.html","
    "); $templateCache.put("select2/select.tpl.html","
    "); $templateCache.put("selectize/choices.tpl.html","
    "); $templateCache.put("selectize/match.tpl.html","
    "); -$templateCache.put("selectize/select.tpl.html","
    ");}]); \ No newline at end of file +$templateCache.put("selectize/select.tpl.html","
    ");}]); diff --git a/package.json b/package.json index 41e7ee781..8ffd92e14 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "repository": { "url": "git://github.com/angular-ui/ui-select.git" }, - "version": "0.12.1", + "version": "0.12.3", "devDependencies": { "bower": "~1.3", "del": "~0.1.1", diff --git a/src/common.css b/src/common.css index e1026d4a1..7942996ea 100644 --- a/src/common.css +++ b/src/common.css @@ -252,3 +252,6 @@ body > .ui-select-bootstrap.open { .ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown { box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25); } +.ui-select-choices .no-result{ + color: #aaa; +} diff --git a/src/select2/choices.tpl.html b/src/select2/choices.tpl.html index f462dab92..a68c48d11 100644 --- a/src/select2/choices.tpl.html +++ b/src/select2/choices.tpl.html @@ -8,4 +8,5 @@ - \ No newline at end of file +
  • 没有搜索结果.
  • + diff --git a/src/uiSelectDirective.js b/src/uiSelectDirective.js index 3d391825c..1c38bcc6c 100644 --- a/src/uiSelectDirective.js +++ b/src/uiSelectDirective.js @@ -273,7 +273,11 @@ uis.directive('uiSelect', var offsetDropdown = uisOffset(dropdown); // Determine if the direction of the dropdown needs to be changed. - if (offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight) { + var _scrollTop = $document[0].documentElement.scrollTop; + if(_scrollTop === 0){ + _scrollTop = angular.element("body")[0].scrollTop; + } + if (offset.top + offset.height + offsetDropdown.height > _scrollTop + $document[0].documentElement.clientHeight) { dropdown[0].style.position = 'absolute'; dropdown[0].style.top = (offsetDropdown.height * -1) + 'px'; element.addClass(directionUpClassName);