Skip to content

Commit c6c5f2a

Browse files
author
Greg Lazarev
committed
Update dist with latest from src
Dist has become out of sync with src, whis is erroring: ```js ReferenceError: uiSelectMinErr is not defined ```
1 parent dc34ce0 commit c6c5f2a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

dist/select.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ angular.module('ui.select', [])
114114
ctrl.open = false;
115115
ctrl.disabled = undefined; // Initialized inside uiSelect directive link function
116116
ctrl.resetSearchInput = undefined; // Initialized inside uiSelect directive link function
117-
ctrl.refreshDelay = undefined; // Initialized inside choices directive link function
117+
ctrl.refreshDelay = undefined; // Initialized inside uiSelectChoices directive link function
118118

119119
var _searchInput = $element.querySelectorAll('input.ui-select-search');
120120
if (_searchInput.length !== 1) {
@@ -174,15 +174,14 @@ angular.module('ui.select', [])
174174
ctrl.refresh = function(refreshAttr) {
175175
if (refreshAttr !== undefined) {
176176

177-
// Throttle / debounce
178-
//
177+
// Debounce
179178
// See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L155
180179
// FYI AngularStrap typeahead does not have debouncing: https://github.com/mgcrea/angular-strap/blob/v2.0.0-rc.4/src/typeahead/typeahead.js#L177
181180
if (_refreshDelayPromise) {
182181
$timeout.cancel(_refreshDelayPromise);
183182
}
184183
_refreshDelayPromise = $timeout(function() {
185-
$scope.$apply(refreshAttr);
184+
$scope.$eval(refreshAttr);
186185
}, ctrl.refreshDelay);
187186
}
188187
};
@@ -233,7 +232,6 @@ angular.module('ui.select', [])
233232
}
234233

235234
// Bind to keyboard shortcuts
236-
// Cannot specify a namespace: not supported by jqLite
237235
_searchInput.on('keydown', function(e) {
238236
// Keyboard shortcuts are all about the items,
239237
// does not make sense (and will crash) if ctrl.items is empty
@@ -282,8 +280,8 @@ angular.module('ui.select', [])
282280
}])
283281

284282
.directive('uiSelect',
285-
['$document', 'uiSelectConfig',
286-
function($document, uiSelectConfig) {
283+
['$document', 'uiSelectConfig', 'uiSelectMinErr',
284+
function($document, uiSelectConfig, uiSelectMinErr) {
287285

288286
return {
289287
restrict: 'EA',
@@ -324,8 +322,7 @@ angular.module('ui.select', [])
324322
$select.selected = ngModel.$viewValue;
325323
};
326324

327-
// See Click everywhere but here event http://stackoverflow.com/questions/12931369
328-
$document.on('mousedown', function(e) {
325+
function onDocumentClick(e) {
329326
var contains = false;
330327

331328
if (window.jQuery) {
@@ -340,10 +337,13 @@ angular.module('ui.select', [])
340337
$select.close();
341338
scope.$digest();
342339
}
343-
});
340+
}
341+
342+
// See Click everywhere but here event http://stackoverflow.com/questions/12931369
343+
$document.on('click', onDocumentClick);
344344

345345
scope.$on('$destroy', function() {
346-
$document.off('mousedown');
346+
$document.off('click', onDocumentClick);
347347
});
348348

349349
// Move transcluded elements to their correct position in main template
@@ -371,7 +371,7 @@ angular.module('ui.select', [])
371371
};
372372
}])
373373

374-
.directive('choices',
374+
.directive('uiSelectChoices',
375375
['uiSelectConfig', 'RepeatParser', 'uiSelectMinErr',
376376
function(uiSelectConfig, RepeatParser, uiSelectMinErr) {
377377

@@ -416,7 +416,7 @@ angular.module('ui.select', [])
416416
};
417417
}])
418418

419-
.directive('match', ['uiSelectConfig', function(uiSelectConfig) {
419+
.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {
420420
return {
421421
restrict: 'EA',
422422
require: '^uiSelect',
@@ -453,10 +453,10 @@ angular.module('ui.select', [])
453453

454454
angular.module('ui.select').run(['$templateCache', function ($templateCache) {
455455
$templateCache.put('bootstrap/choices.tpl.html', '<ul class="ui-select-choices ui-select-choices-content dropdown-menu" role="menu" aria-labelledby="dLabel" ng-show="$select.items.length> 0"> <li class="ui-select-choices-row" ng-class="{active: $select.activeIndex===$index}"> <a href="javascript:void(0)" ng-transclude></a> </li> </ul> ');
456-
$templateCache.put('bootstrap/match.tpl.html', '<button class="btn btn-default form-control ui-select-match" ng-hide="$select.open" ng-disabled="$select.disabled" ng-click="$select.activate()"> <span ng-hide="$select.selected !==undefined" class="text-muted">{{$select.placeholder}}</span> <span ng-show="$select.selected !==undefined" ng-transclude></span> <span class="caret"></span> </button> ');
456+
$templateCache.put('bootstrap/match.tpl.html', '<button type="button" class="btn btn-default form-control ui-select-match" ng-hide="$select.open" ng-disabled="$select.disabled" ng-click="$select.activate()"> <span ng-hide="$select.selected !==undefined" class="text-muted">{{$select.placeholder}}</span> <span ng-show="$select.selected !==undefined" ng-transclude></span> <span class="caret"></span> </button> ');
457457
$templateCache.put('bootstrap/select.tpl.html', '<div class="ui-select-bootstrap dropdown" ng-class="{open: $select.open}"> <div class="ui-select-match"></div> <input type="text" autocomplete="off" tabindex="" class="form-control ui-select-search" placeholder="{{$select.placeholder}}" ng-model="$select.search" ng-show="$select.open"> <div class="ui-select-choices"></div> </div> ');
458458
$templateCache.put('select2/choices.tpl.html', '<ul class="ui-select-choices ui-select-choices-content select2-results"> <li class="ui-select-choices-row" ng-class="{\'select2-highlighted\': $select.activeIndex===$index}"> <div class="select2-result-label" ng-transclude></div> </li> </ul> ');
459-
$templateCache.put('select2/match.tpl.html', '<a class="select2-choice ui-select-match" ng-class="{\'select2-default\': $select.selected === undefined}" ng-click="$select.activate()"> <span ng-hide="$select.selected !==undefined" class="select2-chosen">{{$select.placeholder}}</span> <span ng-show="$select.selected !==undefined" class="select2-chosen" ng-transclude></span> <span class="select2-arrow"><b></b></span> </a> ');
459+
$templateCache.put('select2/match.tpl.html', '<a class="select2-choice ui-select-match" ng-class="{\'select2-default\': $select.selected===undefined}" ng-click="$select.activate()"> <span ng-hide="$select.selected !==undefined" class="select2-chosen">{{$select.placeholder}}</span> <span ng-show="$select.selected !==undefined" class="select2-chosen" ng-transclude></span> <span class="select2-arrow"><b></b></span> </a> ');
460460
$templateCache.put('select2/select.tpl.html', '<div class="select2 select2-container" ng-class="{\'select2-container-active select2-dropdown-open\': $select.open, \'select2-container-disabled\': $select.disabled}"> <div class="ui-select-match"></div> <div class="select2-drop select2-with-searchbox select2-drop-active" ng-class="{\'select2-display-none\': !$select.open}"> <div class="select2-search"> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="ui-select-search select2-input" ng-model="$select.search"> </div> <div class="ui-select-choices"></div> </div> </div> ');
461461
$templateCache.put('selectize/choices.tpl.html', '<div ng-show="$select.open" class="ui-select-choices selectize-dropdown single"> <div class="ui-select-choices-content selectize-dropdown-content"> <div class="ui-select-choices-row" ng-class="{\'active\': $select.activeIndex===$index}"> <div class="option" data-selectable ng-transclude></div> </div> </div> </div> ');
462462
$templateCache.put('selectize/match.tpl.html', '<div ng-hide="$select.open || $select.selected===undefined" class="ui-select-match" ng-transclude></div> ');

0 commit comments

Comments
 (0)