menu update: fixed position, other changes

This commit is contained in:
tmshv committed 2015-08-15 15:39:04 +03:00
1 parent 916c11c516
commit b48b120405
5 files changed
+26 -37

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ body {
.content { .content {
flex: 1; flex: 1;
width: 90%; width: 90%;
margin: 0 auto; margin: 3em auto 0;
} }
a { a {
+14 -11
View File
@@ -1,28 +1,32 @@
header { .main-menu {
nav {
position: fixed;
z-index: 100;
overflow-x: scroll; overflow-x: scroll;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
width: 100%; width: 100%;
max-height: 15em; //max-height: 15em;
background-color: black; background-color: black;
font-size: 1.1em; font-size: 1.1em;
color: #666; color: #666;
list-style: none;
white-space: nowrap;
& :link, & :visited { & :link, & :visited {
text-decoration: none; text-decoration: none;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
color: #a2a2a2; color: #a2a2a2;
} }
ul {
list-style: none;
white-space: nowrap;
li { li {
display: inline-block; /* 6 */ display: inline-block; /* 6 */
padding: 0.3em 0.2em 0.5em; padding: 0.3em 0.2em 0.5em;
margin: 0 0.5em; margin: 0 0.5em;
&:first-child {
margin-left: 1em;
} }
} }
@@ -62,15 +66,14 @@ header {
} }
} }
} }
}
@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%;
} }
} }
}
+5
View File
@@ -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;
});
+4 -16
View File
@@ -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) {
try{
var path = current['$$route'].originalPath; var path = current['$$route'].originalPath;
menu.activate(path); 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
View File
@@ -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">