Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
less files update
Browse files Browse the repository at this point in the history
  • Loading branch information
erkobridee committed Nov 7, 2013
1 parent 1100057 commit a178ca8
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
76 changes: 76 additions & 0 deletions app/main/menuConfig.js
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

}]);
47 changes: 47 additions & 0 deletions shared/styles/bs-callout.less
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;
}
9 changes: 9 additions & 0 deletions styles/less/app.less
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';

/*-------------------------------------------------- */

0 comments on commit a178ca8

Please sign in to comment.