-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement the local nav without multi-transclusion
The local navigation directive does not require the multi-transclusion workaround anymore. Instead, it comes with a set of child directives (`localNavigationRow` and `localNavigationRowSection`) that can be used to compose a complete local navigation declaratively.
- Loading branch information
1 parent
dbaed4f
commit 840278f
Showing
7 changed files
with
72 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import './local_navigation'; | ||
import './local_navigation_row'; | ||
import './local_navigation_row_section'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import _ from 'lodash'; | ||
import angular from 'angular'; | ||
import uiModules from 'ui/modules'; | ||
|
||
import 'ui/multi_transclude'; | ||
import './local_navigation.less'; | ||
import localNavigationTemplate from './local_navigation.html'; | ||
|
||
|
||
const module = uiModules.get('kibana'); | ||
|
||
module.directive('localNavigation', function LocalNavigation() { | ||
return { | ||
replace: true, | ||
restrict: 'E', | ||
template: localNavigationTemplate, | ||
template: '<div class="localNav" ng-transclude></div>', | ||
transclude: true, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import uiModules from 'ui/modules'; | ||
|
||
import './local_navigation.less'; | ||
|
||
|
||
const module = uiModules.get('kibana'); | ||
|
||
module.directive('localNavigationRow', function LocalNavigationRow() { | ||
return { | ||
replace: true, | ||
restrict: 'E', | ||
scope: { | ||
isSecondary: '=?', | ||
}, | ||
template: `<div class="localNavRow" ng-class="{ 'localNavigationRow--secondary': isSecondary }" ng-transclude></div>`, | ||
transclude: true, | ||
}; | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/ui/public/local_navigation/local_navigation_row_section.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import uiModules from 'ui/modules'; | ||
|
||
import './local_navigation.less'; | ||
|
||
|
||
const module = uiModules.get('kibana'); | ||
|
||
module.directive('localNavigationRowSection', function LocalNavigationRowSection() { | ||
return { | ||
replace: true, | ||
restrict: 'E', | ||
template: '<div class="localNavRow__section" ng-transclude></div>', | ||
transclude: true, | ||
}; | ||
}); |