This is an automated email from the ASF dual-hosted git repository. heneveld pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git
commit d585befe1199ccbc33b08e5e938644203828fe4f Author: Alex Heneveld <[email protected]> AuthorDate: Wed Oct 5 13:57:49 2022 +0100 essential changes to drodown-nested so it loads without conflicting --- ui-modules/app-inspector/app/index.js | 2 ++ .../inspect/activities/detail/dropdown-nested.js | 34 ++++++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ui-modules/app-inspector/app/index.js b/ui-modules/app-inspector/app/index.js index c82707b3..d8c00ebf 100755 --- a/ui-modules/app-inspector/app/index.js +++ b/ui-modules/app-inspector/app/index.js @@ -21,6 +21,7 @@ import ngCookies from "angular-cookies"; import ngResource from "angular-resource"; import ngSanitize from "angular-sanitize"; import uiRouter from "angular-ui-router"; +import dropdownNested from "views/main/inspect/activities/detail/dropdown-nested"; import brCore from 'brooklyn-ui-utils/br-core/br-core'; @@ -68,6 +69,7 @@ import brandAngularJs from 'brand-angular-js'; const IS_PRODUCTION = process.env.NODE_ENV === 'production' || false; angular.module('brooklynAppInspector', [ngResource, ngCookies, ngSanitize, uiRouter, brCore, brUtilsGeneral, + dropdownNested, brServerStatus, brIconGenerator, brInterstitialSpinner, brooklynModuleLinks, brSensitiveField, brooklynUserManagement, brYamlEditor, brWebNotifications, brExpandablePanel, 'xeditable', brLogbook, apiProvider, entityTree, loadingState, configSensorTable, entityEffector, entityPolicy, breadcrumbNavigation, taskList, taskSunburst, stream, adjunctsList, diff --git a/ui-modules/app-inspector/app/views/main/inspect/activities/detail/dropdown-nested.js b/ui-modules/app-inspector/app/views/main/inspect/activities/detail/dropdown-nested.js index cbfe420f..6d983bb9 100644 --- a/ui-modules/app-inspector/app/views/main/inspect/activities/detail/dropdown-nested.js +++ b/ui-modules/app-inspector/app/views/main/inspect/activities/detail/dropdown-nested.js @@ -1,11 +1,15 @@ -angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap.position']) +const MODULE_NAME = 'ui.bootstrap.dropdown.nested'; - .constant('uibDropdownConfig', { +export default MODULE_NAME; + +angular.module(MODULE_NAME, ['ui.bootstrap.multiMap', 'ui.bootstrap.position']) + + .constant('uibDropdownConfigNested', { appendToOpenClass: 'uib-dropdown-open', openClass: 'open' }) - .service('uibDropdownService', ['$document', '$rootScope', '$$multiMap', function($document, $rootScope, $$multiMap) { + .service('uibDropdownServiceNested', ['$document', '$rootScope', '$$multiMap', function($document, $rootScope, $$multiMap) { var openScope = null; var openedContainers = $$multiMap.createNew(); @@ -135,7 +139,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap. }; }]) - .controller('UibDropdownController', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfig', 'uibDropdownService', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownService, $animate, $position, $document, $compile, $templateRequest) { + .controller('UibDropdownControllerNested', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfigNested', 'uibDropdownServiceNested', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownServiceNested, $animate, $position, $document, $compile, $templateRequest) { var self = this, scope = $scope.$new(), // create a child scope so we are not polluting original one templateScope, @@ -317,7 +321,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap. var openContainer = appendTo ? appendTo : $element; var dropdownOpenClass = appendTo ? appendToOpenClass : openClass; var hasOpenClass = openContainer.hasClass(dropdownOpenClass); - var isOnlyOpen = uibDropdownService.isOnlyOpen($scope, appendTo); + var isOnlyOpen = uibDropdownServiceNested.isOnlyOpen($scope, appendTo); if (hasOpenClass === !isOpen) { var toggleClass; @@ -341,17 +345,17 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap. var newEl = dropdownElement; self.dropdownMenu.replaceWith(newEl); self.dropdownMenu = newEl; - $document.on('keydown', uibDropdownService.keybindFilter); + $document.on('keydown', uibDropdownServiceNested.keybindFilter); }); }); } else { - $document.on('keydown', uibDropdownService.keybindFilter); + $document.on('keydown', uibDropdownServiceNested.keybindFilter); } scope.focusToggleElement(); - uibDropdownService.open(scope, $element, appendTo); + uibDropdownServiceNested.open(scope, $element, appendTo); } else { - uibDropdownService.close(scope, $element, appendTo); + uibDropdownServiceNested.close(scope, $element, appendTo); if (self.dropdownMenuTemplateUrl) { if (templateScope) { templateScope.$destroy(); @@ -370,19 +374,19 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap. }); }]) - .directive('uibDropdown', function() { + .directive('uibDropdownNested', function() { return { - controller: 'UibDropdownController', + controller: 'UibDropdownControllerNested', link: function(scope, element, attrs, dropdownCtrl) { dropdownCtrl.init(); } }; }) - .directive('uibDropdownMenu', function() { + .directive('uibDropdownMenuNested', function() { return { restrict: 'A', - require: '?^uibDropdown', + require: '?^uibDropdownNested', link: function(scope, element, attrs, dropdownCtrl) { if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) { return; @@ -402,9 +406,9 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap. }; }) - .directive('uibDropdownToggle', function() { + .directive('uibDropdownToggleNested', function() { return { - require: '?^uibDropdown', + require: '?^uibDropdownNested', link: function(scope, element, attrs, dropdownCtrl) { if (!dropdownCtrl) { return;
