This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1100057
commit a178ca8
Showing
3 changed files
with
132 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
angular.module('app').factory( | ||
|
||
// factory name | ||
'MenuConfig', | ||
|
||
// dependencies injection | ||
['$rootScope', '$location', | ||
|
||
// factory definition | ||
function($scope, $location) { | ||
|
||
var menuItemFn, | ||
addMenuItemFn, | ||
selectMenuItemFn, | ||
checkLocationFn, | ||
menuItemSelected = null, | ||
locationsMap = {} | ||
menuItems = []; | ||
|
||
//--- @begin: internal functions | ||
menuItemFn = function(label, location, css) { | ||
return { | ||
label: label, | ||
location: '/'+location, | ||
url: '#'+location, | ||
css: (css || '') // 'active' | ||
}; | ||
} | ||
|
||
addMenuItemFn = function(label, location) { | ||
var menuItem = menuItemFn(label, location); | ||
locationsMap[menuItem.location] = menuItem; | ||
menuItems.push(menuItem); | ||
//menuItems = [menuItem].concat(menuItems); | ||
} | ||
|
||
selectMenuItemFn = function(item) { | ||
if(item !== menuItemSelected) { | ||
if(menuItemSelected !== null) menuItemSelected.css = ''; | ||
item.css = 'active'; | ||
menuItemSelected = item; | ||
} | ||
} | ||
|
||
checkLocationFn = function() { | ||
var path, splitArr, location; | ||
|
||
path = $location.path(); | ||
splitArr = path.split('/'); | ||
if(splitArr.length > 2) { | ||
path = '/'+splitArr[1]; | ||
splitArr = null; | ||
} | ||
|
||
location = locationsMap[path]; | ||
if(location) { | ||
selectMenuItemFn(location); | ||
} | ||
} | ||
//--- @end: internal functions | ||
|
||
//--- @begin: $scope config | ||
$scope.menuItems = menuItems; | ||
|
||
$scope.location = $location; | ||
$scope.$watch("location.path()", checkLocationFn, true); | ||
//--- @end: $scope config | ||
|
||
|
||
//--- @begin: public functions | ||
return { | ||
addMenuItem: addMenuItemFn | ||
}; | ||
//--- @end: public functions | ||
|
||
}]); |
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,47 @@ | ||
/* source: twitter bootstrap | ||
https://github.com/twbs/bootstrap/blob/master/docs-assets/css/docs.css | ||
*/ | ||
|
||
/* | ||
* Callouts | ||
* | ||
* Not quite alerts, but custom and helpful notes for folks reading the docs. | ||
* Requires a base and modifier class. | ||
*/ | ||
|
||
/* Common styles for all types */ | ||
.bs-callout { | ||
margin: 20px 0; | ||
padding: 20px; | ||
border-left: 3px solid #eee; | ||
} | ||
.bs-callout h4 { | ||
margin-top: 0; | ||
margin-bottom: 5px; | ||
} | ||
.bs-callout p:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
/* Variations */ | ||
.bs-callout-danger { | ||
background-color: #fdf7f7; | ||
border-color: #eed3d7; | ||
} | ||
.bs-callout-danger h4 { | ||
color: #b94a48; | ||
} | ||
.bs-callout-warning { | ||
background-color: #faf8f0; | ||
border-color: #faebcc; | ||
} | ||
.bs-callout-warning h4 { | ||
color: #c09853; | ||
} | ||
.bs-callout-info { | ||
background-color: #f4f8fa; | ||
border-color: #bce8f1; | ||
} | ||
.bs-callout-info h4 { | ||
color: #3a87ad; | ||
} |
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,4 +1,13 @@ | ||
|
||
@import 'shared/styles/top-bottom-screen.less'; | ||
|
||
/*-------------------------------------------------- */ | ||
|
||
@import 'shared/styles/bs-callout.less'; | ||
|
||
/*-------------------------------------------------- */ | ||
|
||
@import 'shared/components/loadingBar/ngProgress.less'; | ||
|
||
/*-------------------------------------------------- */ | ||
|