Skip to content

Commit a20c661

Browse files
added left sidebar menu
1 parent fca01ce commit a20c661

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

controllers/controllers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Include app dependency on ngMaterial
22
var app = angular.module( 'YourApp', [ 'ngMaterial' ] );
3-
app.controller("YourController", ['$scope', '$mdDialog', function($scope, $mdDialog) {
3+
app.controller("YourController", ['$scope', '$mdDialog', '$mdSidenav', function($scope, $mdDialog, $mdSidenav) {
44

55
$scope.openDialog = function($event) {
66
$mdDialog.show({
@@ -24,6 +24,10 @@ app.controller("YourController", ['$scope', '$mdDialog', function($scope, $mdDia
2424
}
2525
};
2626

27+
$scope.toggleMenu = function(){
28+
$mdSidenav('left').toggle();
29+
};
30+
2731
$scope.chunks = [
2832
{
2933
title: "Something",

index.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@
1010
<header>
1111
<md-toolbar scroll-shrink>
1212
<div class="md-toolbar-tools">
13+
<md-button ng-click="toggleMenu()">Menu</md-button>
1314
<h3>
1415
<span>Angular Material Inbox</span>
1516
</h3>
1617
</div>
1718
</md-toolbar>
1819
</header>
1920
<div layout="vertical" flex>
21+
<md-sidenav class="md-sidenav-left" component-id="left">
22+
<md-toolbar class="md-theme-indigo">
23+
<h1 class="md-toolbar-tools">Sidenav Left</h1>
24+
</md-toolbar>
25+
<md-content flex>
26+
<p>Stuff</p>
27+
</md-content>
28+
</md-sidenav>
2029
<md-content layout="horizontal" layout-align="center">
2130
<md-list id="content">
2231
<div ng-repeat="chunk in ::chunks">
@@ -54,7 +63,7 @@ <h2>Some Post</h2>
5463
</md-content>
5564
</div>
5665

57-
<div layout="vertical" layout-align="space-between" style="height: 260px; position: fixed; right: 40px; bottom: 90px;" ng-if="showAddButtons" ng-animate="{enter: 'animate-enter', leave: 'animate-leave'}">
66+
<div id="fab-popup" layout="vertical" layout-align="space-between" ng-if="showAddButtons" ng-animate="{enter: 'animate-enter', leave: 'animate-leave'}">
5867
<md-button class="md-fab md-raised" ng-click="openDialog($event);" aria-label="New document">
5968
<md-icon icon="bower_components/material-design-icons/content/svg/production/ic_add_24px.svg" style="width: 24px; height: 24px;"></md-icon>
6069
<md-tooltip>
@@ -84,18 +93,6 @@ <h2>Some Post</h2>
8493
<md-button id="mainFab" class="md-fab md-raised" ng-click="showAddButtons = !showAddButtons;" aria-label="New document">
8594
<md-icon icon="bower_components/material-design-icons/content/svg/production/ic_add_24px.svg" style="width: 24px; height: 24px;"></md-icon>
8695
</md-button>
87-
<!--<md-bottom-sheet class="md-list md-has-header">-->
88-
<!--<md-subheader>Comment Actions</md-subheader>-->
89-
<!--<md-list>-->
90-
<!--<md-item ng-repeat="item in items" ng-click="showGridBottomSheet($event)">-->
91-
<!--<md-button>-->
92-
<!--&lt;!&ndash; Using custom inline icon until md-icon is ready. DONT USE ME! &ndash;&gt;-->
93-
<!--<md-inline-list-icon icon="{{item.icon}}"></md-inline-list-icon>-->
94-
<!--<span class="md-inline-list-icon-label">{{ item.name }}</span>-->
95-
<!--</md-button>-->
96-
<!--</md-item>-->
97-
<!--</md-list>-->
98-
<!--</md-bottom-sheet>-->
9996

10097
<script src="/bower_components/angular/angular.js"></script>
10198
<script src="/bower_components/angular-aria/angular-aria.js"></script>

style.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ md-card {
2929
opacity: 0;
3030
}
3131

32+
.animate-enter.animate-enter-active {
33+
opacity: 1;
34+
}
35+
3236
.round-face {
3337
border-radius: 30px;
3438
border: 1px solid #ddd;
@@ -39,7 +43,7 @@ md-card {
3943

4044
#mainFab {
4145
position: fixed;
42-
right: 42px;
46+
right: 2%;
4347
bottom: 24px;
4448
background-color: #db4437;
4549
}
@@ -48,6 +52,13 @@ md-card {
4852
fill: white;
4953
}
5054

55+
#fab-popup {
56+
height: 260px;
57+
position: fixed;
58+
right: 2%;
59+
bottom: 90px;
60+
}
61+
5162
#content {
5263
min-width: 70%;
5364
}

0 commit comments

Comments
 (0)