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:
Michael Abashian
2016-02-11 13:38:52 -05:00
parent 62ad03ce5a
commit bf74cbc993
3 changed files with 16 additions and 3 deletions

View File

@@ -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;

View File

@@ -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') {

View File

@@ -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>