Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit fa47fba

Browse files
committed
chore(bump): bump to 0.14.0
1 parent 8da8a6d commit fa47fba

File tree

6 files changed

+54
-19
lines changed

6 files changed

+54
-19
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<a name="0.14.0"></a>
2+
# [0.14.0](https://github.com/angular-ui/ui-select/compare/v0.13.3...v0.14.0) (2016-01-25)
3+
4+
5+
### Features
6+
7+
* **ngAnimate:** add support for ngAnimate ([8da8a6d](https://github.com/angular-ui/ui-select/commit/8da8a6d))
8+
9+
10+
111
<a name="0.13.3"></a>
212
## [0.13.3](https://github.com/angular-ui/ui-select/compare/v0.13.3...v0.13.2) (2016-01-25)
313

dist/select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.13.3 - 2016-01-25T22:55:58.326Z
4+
* Version: 0.13.3 - 2016-01-25T23:01:33.538Z
55
* License: MIT
66
*/
77

dist/select.js

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.13.3 - 2016-01-25T22:55:58.249Z
4+
* Version: 0.13.3 - 2016-01-25T23:01:33.462Z
55
* License: MIT
66
*/
77

@@ -254,8 +254,8 @@ uis.directive('uiSelectChoices',
254254
* put as much logic in the controller (instead of the link functions) as possible so it can be easily tested.
255255
*/
256256
uis.controller('uiSelectCtrl',
257-
['$scope', '$element', '$timeout', '$filter', 'uisRepeatParser', 'uiSelectMinErr', 'uiSelectConfig', '$parse',
258-
function($scope, $element, $timeout, $filter, RepeatParser, uiSelectMinErr, uiSelectConfig, $parse) {
257+
['$scope', '$element', '$timeout', '$filter', 'uisRepeatParser', 'uiSelectMinErr', 'uiSelectConfig', '$parse', '$injector',
258+
function($scope, $element, $timeout, $filter, RepeatParser, uiSelectMinErr, uiSelectConfig, $parse, $injector) {
259259

260260
var ctrl = this;
261261

@@ -290,11 +290,21 @@ uis.controller('uiSelectCtrl',
290290
ctrl.clickTriggeredSelect = false;
291291
ctrl.$filter = $filter;
292292

293+
// Use $injector to check for $animate and store a reference to it
294+
ctrl.$animate = (function () {
295+
try {
296+
return $injector.get('$animate');
297+
} catch (err) {
298+
// $animate does not exist
299+
return null;
300+
}
301+
})();
302+
293303
ctrl.searchInput = $element.querySelectorAll('input.ui-select-search');
294304
if (ctrl.searchInput.length !== 1) {
295305
throw uiSelectMinErr('searchInput', "Expected 1 input.ui-select-search but got '{0}'.", ctrl.searchInput.length);
296306
}
297-
307+
298308
ctrl.isEmpty = function() {
299309
return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '';
300310
};
@@ -339,14 +349,29 @@ uis.controller('uiSelectCtrl',
339349
ctrl.activeIndex = 0;
340350
}
341351

342-
// Give it time to appear before focus
343-
$timeout(function() {
344-
ctrl.search = initSearchValue || ctrl.search;
345-
ctrl.searchInput[0].focus();
346-
if(!ctrl.tagging.isActivated && ctrl.items.length > 1) {
347-
_ensureHighlightVisible();
348-
}
349-
});
352+
var container = $element.querySelectorAll('.ui-select-choices-content');
353+
if (ctrl.$animate && ctrl.$animate.enabled(container[0])) {
354+
ctrl.$animate.on('enter', container[0], function (elem, phase) {
355+
if (phase === 'close') {
356+
// Only focus input after the animation has finished
357+
$timeout(function () {
358+
ctrl.focusSearchInput(initSearchValue);
359+
});
360+
}
361+
});
362+
} else {
363+
$timeout(function () {
364+
ctrl.focusSearchInput(initSearchValue);
365+
});
366+
}
367+
}
368+
};
369+
370+
ctrl.focusSearchInput = function (initSearchValue) {
371+
ctrl.search = initSearchValue || ctrl.search;
372+
ctrl.searchInput[0].focus();
373+
if(!ctrl.tagging.isActivated && ctrl.items.length > 1) {
374+
_ensureHighlightVisible();
350375
}
351376
};
352377

@@ -398,7 +423,7 @@ uis.controller('uiSelectCtrl',
398423
//If collection is an Object, convert it to Array
399424

400425
var originalSource = ctrl.parserResult.source;
401-
426+
402427
//When an object is used as source, we better create an array and use it as 'source'
403428
var createArrayFromObject = function(){
404429
var origSrc = originalSource($scope);
@@ -444,7 +469,7 @@ uis.controller('uiSelectCtrl',
444469
ctrl.items = [];
445470
} else {
446471
if (!angular.isArray(items)) {
447-
throw uiSelectMinErr('items', "Expected an array but got '{0}'.", items);
472+
throw uiSelectMinErr('items', "Expected an array but got '{0}'.", items);
448473
} else {
449474
//Remove already selected items (ex: while searching)
450475
//TODO Should add a test

dist/select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": {
77
"url": "git://github.com/angular-ui/ui-select.git"
88
},
9-
"version": "0.13.3",
9+
"version": "0.14.0",
1010
"devDependencies": {
1111
"bower": "~1.3",
1212
"conventional-changelog": "^0.5.3",

0 commit comments

Comments
 (0)