Sha256: c95dd6f86e43ba857cb774e1b0763b2894ed2982df7859b96475a8f7fddc0349

Contents?: true

Size: 763 Bytes

Versions: 204

Compression:

Stored size: 763 Bytes

Contents

(function () {
    'use strict';

    /**
     * @ngdoc directive
     * @name  Bastion.components.directive:bstOnEnter
     *
     * @description
     *   Allows setting an action to be performed when the user presses the enter button.
     */
    function bstOnEnter() {
        return {
            scope: true,
            link: function (scope, element, attrs) {
                element.bind('keydown keypress', function (event) {
                    if (event.which === 13) {
                        scope.$apply(attrs.bstOnEnter);
                        event.preventDefault();
                    }
                });
            }
        };
    }

    angular
        .module('Bastion.components')
        .directive('bstOnEnter', bstOnEnter);

})();

Version data entries

204 entries across 204 versions & 2 rubygems

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