UI improvements to entity-search and the create-external-notification-dialog

This commit is contained in:
Joseph Schorr 2014-07-18 16:51:05 -04:00
parent 752efb9e0f
commit d5d9cb7a45
3 changed files with 37 additions and 3 deletions

View file

@ -3985,7 +3985,9 @@ quayApp.directive('dropdownSelect', function ($compile) {
'placeholder': '=placeholder',
'lookaheadItems': '=lookaheadItems',
'handleItemSelected': '&handleItemSelected',
'handleInput': '&handleInput'
'handleInput': '&handleInput',
'clearValue': '=clearValue'
},
controller: function($scope, $element, $rootScope) {
if (!$rootScope.__dropdownSelectCounter) {
@ -3998,6 +4000,13 @@ quayApp.directive('dropdownSelect', function ($compile) {
// Setup lookahead.
var input = $($element).find('.lookahead-input');
$scope.$watch('clearValue', function(cv) {
if (cv) {
$scope.selectedItem = null;
$(input).val('');
}
});
$scope.$watch('selectedItem', function(item) {
if ($scope.selectedItem == $scope.internalItem) {
// The item has already been set due to an internal action.
@ -4743,6 +4752,7 @@ quayApp.directive('createExternalNotificationDialog', function () {
$scope.currentMethod = null;
$scope.creating = false;
$scope.currentConfig = {};
$scope.clearCounter = 0;
$scope.events = ExternalNotificationData.getSupportedEvents();
$scope.methods = ExternalNotificationData.getSupportedMethods();
@ -4777,6 +4787,7 @@ quayApp.directive('createExternalNotificationDialog', function () {
$scope.$watch('counter', function(counter) {
if (counter) {
$scope.clearCounter++;
$scope.creating = false;
$scope.currentEvent = null;
$scope.currentMethod = null;