mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
Applied select2 to the activity stream dropdown nav. Went ahead and moved the dropdown nav template into a partial rather than having it inline.
This commit is contained in:
@@ -181,6 +181,10 @@ table, tbody {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.List-auxActionStream {
|
||||||
|
width: 175px;
|
||||||
|
}
|
||||||
|
|
||||||
.List-buttonSubmit {
|
.List-buttonSubmit {
|
||||||
background-color: @submit-button-bg;
|
background-color: @submit-button-bg;
|
||||||
color: @submit-button-text;
|
color: @submit-button-text;
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default [function() {
|
export default ['templateUrl', function(templateUrl) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
scope: true,
|
scope: true,
|
||||||
replace: true,
|
replace: true,
|
||||||
template: '<select class="form-control" ng-model="streamTarget" ng-options="opt.value as opt.label for opt in options" ng-change="changeStreamTarget()"></select>',
|
templateUrl: templateUrl('activity-stream/streamDropdownNav/stream-dropdown-nav'),
|
||||||
controller: ['$scope', '$state', function($scope, $state) {
|
controller: ['$scope', '$state', 'CreateSelect2', function($scope, $state, CreateSelect2) {
|
||||||
|
|
||||||
$scope.streamTarget = ($state.params && $state.params.target) ? $state.params.target : 'dashboard';
|
$scope.streamTarget = ($state.params && $state.params.target) ? $state.params.target : 'dashboard';
|
||||||
|
|
||||||
@@ -29,6 +29,11 @@ export default [function() {
|
|||||||
{label: 'Users', value: 'user'}
|
{label: 'Users', value: 'user'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
CreateSelect2({
|
||||||
|
element:'#stream-dropdown-nav',
|
||||||
|
multiple: false
|
||||||
|
});
|
||||||
|
|
||||||
$scope.changeStreamTarget = function(){
|
$scope.changeStreamTarget = function(){
|
||||||
|
|
||||||
if($scope.streamTarget && $scope.streamTarget == 'dashboard') {
|
if($scope.streamTarget && $scope.streamTarget == 'dashboard') {
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div class="List-auxActionStream">
|
||||||
|
<select id="stream-dropdown-nav" class="form-control" ng-model="streamTarget" ng-options="opt.value as opt.label for opt in options" ng-change="changeStreamTarget()">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user