Sha256: f253d233cc6966f90963dac84d89a40e2c0c38e37bbbd014da3eab35f05b58c4

Contents?: true

Size: 846 Bytes

Versions: 234

Compression:

Stored size: 846 Bytes

Contents

/**
 * @ngdoc directive
 * @name Bastion.components.directive:typeaheadEmpty
 *
 *
 * @description
 *  Used to support autocompletion on focus, not just after the user types a single character
 *
 * @example
    <input
    typeahead="item as item.label for item in table.autocomplete($viewValue)"
    typeahead-empty />
 */

angular.module('Bastion.components').directive('typeaheadEmpty', function () {
    return {
        require: 'ngModel',
        link: function (scope, element, attrs, modelCtrl) {
            element.bind('focus', function () {
                if (angular.isUndefined(modelCtrl.$viewValue) || modelCtrl.$viewValue === '') {
                    modelCtrl.$setViewValue(' ');
                } else {
                    modelCtrl.$setViewValue(modelCtrl.$viewValue);
                }
            });
        }
    };
});

Version data entries

234 entries across 234 versions & 2 rubygems

Version Path
katello-4.15.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.15.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.0.rc3 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.0.rc1.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.14.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.13.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.13.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.12.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.13.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.12.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.12.0.rc3 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.12.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.12.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.11.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.11.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.11.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.11.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js