menu update: fixed position, other changes
This commit is contained in:
1 parent
916c11c516
commit
b48b120405
5 files changed
+70
-81
No files matched your search
@@ -21,7 +21,7 @@ body {
|
|||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 auto;
|
margin: 3em auto 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
|||||||
+56
-53
@@ -1,76 +1,79 @@
|
|||||||
header {
|
.main-menu {
|
||||||
nav {
|
|
||||||
overflow-x: scroll;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
width: 100%;
|
|
||||||
max-height: 15em;
|
|
||||||
|
|
||||||
background-color: black;
|
position: fixed;
|
||||||
font-size: 1.1em;
|
z-index: 100;
|
||||||
color: #666;
|
overflow-x: scroll;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
width: 100%;
|
||||||
|
//max-height: 15em;
|
||||||
|
|
||||||
& :link, & :visited {
|
background-color: black;
|
||||||
text-decoration: none;
|
font-size: 1.1em;
|
||||||
border-bottom: 1px solid #333;
|
color: #666;
|
||||||
color: #a2a2a2;
|
|
||||||
|
list-style: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
& :link, & :visited {
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid #333;
|
||||||
|
color: #a2a2a2;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inline-block; /* 6 */
|
||||||
|
padding: 0.3em 0.2em 0.5em;
|
||||||
|
margin: 0 0.5em;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
a:hover {
|
||||||
list-style: none;
|
color: white;
|
||||||
white-space: nowrap;
|
border-bottom: 1px solid #555;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
.selected {
|
||||||
display: inline-block; /* 6 */
|
border-top: 4px solid white;
|
||||||
padding: 0.3em 0.2em 0.5em;
|
font-weight: bold;
|
||||||
margin: 0 0.5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
a:link, a:visited {
|
||||||
color: white;
|
color: white;
|
||||||
border-bottom: 1px solid #555;
|
text-decoration: none;
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected {
|
&.blue {
|
||||||
border-top: 4px solid white;
|
border-top: 4px solid #3f9cea;
|
||||||
font-weight: bold;
|
}
|
||||||
|
|
||||||
a:link, a:visited {
|
&.green {
|
||||||
color: white;
|
border-top: 4px solid #5cbe40;
|
||||||
text-decoration: none;
|
}
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.blue {
|
&.yellow {
|
||||||
border-top: 4px solid #3f9cea;
|
border-top: 4px solid #ffee00;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.green {
|
&.pink {
|
||||||
border-top: 4px solid #5cbe40;
|
border-top: 4px solid #f655a0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.yellow {
|
&.red {
|
||||||
border-top: 4px solid #ffee00;
|
border-top: 4px solid #f61b14;
|
||||||
}
|
|
||||||
|
|
||||||
&.pink {
|
|
||||||
border-top: 4px solid #f655a0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.red {
|
|
||||||
border-top: 4px solid #f61b14;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 31.25em) {
|
@media (min-width: 31.25em) {
|
||||||
header{
|
header{
|
||||||
max-height: none;
|
//max-height: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
nav ul {
|
.main-menu {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,6 +80,7 @@ app.run(function ($location, $rootScope, $http) {
|
|||||||
|
|
||||||
require("./api/api")(app);
|
require("./api/api")(app);
|
||||||
require("./services/io")(app);
|
require("./services/io")(app);
|
||||||
|
require("./directives/mainMenu")(app);
|
||||||
require("./ui/menu")(app);
|
require("./ui/menu")(app);
|
||||||
require("./ui/breadcrumbs")(app);
|
require("./ui/breadcrumbs")(app);
|
||||||
require("./ui/timeline")(app);
|
require("./ui/timeline")(app);
|
||||||
@@ -106,3 +107,7 @@ app.controller("TeamPageController", function ($scope) {
|
|||||||
app.controller("DocsPageController", function ($scope) {
|
app.controller("DocsPageController", function ($scope) {
|
||||||
$scope.pageClass = "page-docs";
|
$scope.pageClass = "page-docs";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.controller("AppController", function ($scope, menu) {
|
||||||
|
$scope.menuProvider = menu.items;
|
||||||
|
});
|
||||||
+6
-18
@@ -21,26 +21,14 @@ module.exports = function (app) {
|
|||||||
|
|
||||||
var menu = new Menu();
|
var menu = new Menu();
|
||||||
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
||||||
var path = current['$$route'].originalPath;
|
try{
|
||||||
menu.activate(path);
|
var path = current['$$route'].originalPath;
|
||||||
|
menu.activate(path);
|
||||||
|
}catch(e){
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
});
|
});
|
||||||
|
|
||||||
app.controller("MenuController", function ($scope, menu) {
|
|
||||||
$scope.menu = menu;
|
|
||||||
|
|
||||||
$scope.isActive = function (item) {
|
|
||||||
if(menu.current) {
|
|
||||||
return item.url == menu.current.url;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.isValid = function (item) {
|
|
||||||
return 'url' in item;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
+2
-9
@@ -44,16 +44,9 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
<div class="wrapper" ng-controller="AppController">
|
||||||
<header>
|
<header>
|
||||||
<nav role="navigation" ng-controller="MenuController">
|
<main-menu items="menuProvider"></main-menu>
|
||||||
<ul>
|
|
||||||
<li ng-repeat="item in menu.items" class="{{item.color}}" ng-class="{selected: isActive(item)}">
|
|
||||||
<span ng-hide="isValid(item)">{{item.text}}</span>
|
|
||||||
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
Reference in new issue
Block a user