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.10.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.9.2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.10.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.10.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.4 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.9.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.3 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.9.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.7.6 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.9.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.9.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.7.5 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.0 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.0.rc2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.7.4 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.8.0.rc1 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.7.3 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js
katello-4.7.2 engines/bastion/app/assets/javascripts/bastion/components/typeahead-empty.directive.js