Sha256: 37796d462fbb2bdcf672b54f6c46e578242d495ebd4f4d82421fa3c9bf9ba94c

Contents?: true

Size: 1.4 KB

Versions: 207

Compression:

Stored size: 1.4 KB

Contents

(function () {
    'use strict';

    /**
     * @ngdoc directive
     * @name Bastion.common.directive:selectActionDropdown
     *
     * @description
     *   Used to create a dropdown menu with a list of actions in it and the words "Select Action" on the button.
     *
     *   Necessary because of https://github.com/angular-ui/bootstrap/issues/5841
     *
     * @example
     *  <span select-action-dropdown>
     *    <ul>...</ul>
     *  </span>
     */
    function selectActionDropdown() {
        return {
            restrict: 'AE',
            transclude: true,
            scope: true,
            templateUrl: 'common/views/select-action-dropdown.html',
            compile: function (tElement, tAttribute, transclude) {
                return function (scope, element) {
                    scope.status = {
                        isOpen: false
                    };

                    scope.toggleDropdown = function (event) {
                        event.preventDefault();
                        event.stopPropagation();
                        scope.status.isOpen = !scope.status.isOpen;
                    };

                    transclude(scope, function(clone) {
                        element.find('.btn-group').append(clone);
                    });
                };
            }
        };
    }

    angular.module('Bastion.common').directive('selectActionDropdown', selectActionDropdown);
})();

Version data entries

207 entries across 207 versions & 1 rubygems

Version Path
katello-4.14.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.15.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.14.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.13.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.13.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.12.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.13.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.12.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.12.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.12.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.12.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js
katello-4.11.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/common/select-action-dropdown.directive.js