Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit eb7628f

Browse files
committed
docs(): polish buttons & transitions
1 parent 8c5ecd4 commit eb7628f

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

docs/app/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.hide { display: none !important; }
12

23
body {
34
overflow: hidden;

docs/app/js/app.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ function(COMPONENTS, DEMOS, PAGES, $routeProvider) {
2020
angular.forEach(pages, function(page) {
2121
$routeProvider
2222
.when(page.url, {
23-
templateUrl: page.outputPath
23+
templateUrl: page.outputPath,
24+
controller: 'GuideCtrl'
2425
});
2526
});
2627
});
@@ -69,9 +70,7 @@ function(COMPONENTS, DEMOS, PAGES, $routeProvider) {
6970
'$rootScope',
7071
'$timeout',
7172
function(Angularytics, $rootScope,$timeout) {
72-
//$timeout(function(){
73-
Angularytics.init()
74-
//});
73+
Angularytics.init();
7574
}])
7675

7776
.factory('menu', [
@@ -264,6 +263,13 @@ function($scope, $rootScope, $http) {
264263

265264
}])
266265

266+
267+
.controller('GuideCtrl', [
268+
'$rootScope',
269+
function($rootScope) {
270+
$rootScope.currentComponent = $rootScope.currentDoc = null;
271+
}])
272+
267273
.controller('LayoutCtrl', [
268274
'$scope',
269275
'$attrs',

docs/config/template/index.template.html

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ <h1 class="md-toolbar-tools" flex layout="column">
6464
<div layout="column" layout-fill tabIndex="-1" role="main">
6565
<md-toolbar layout="column">
6666
<div class="md-toolbar-tools" ng-click="openMenu()" flex layout="column">
67+
6768
<div layout="row" flex>
6869
<button class="menu-icon" show hide-gt-md aria-label="Toggle Menu" style="position: relative; top: -5px;">
6970
<md-icon icon="img/icons/ic_menu_24px.svg"></md-icon>
@@ -74,18 +75,29 @@ <h1 class="md-toolbar-tools" flex layout="column">
7475
</span>
7576
<div style="line-height: 28px;" ng-bind="(menu.currentPage | humanizeDoc) || 'Angular Material'"></div>
7677
<div flex></div>
77-
<md-button ng-if="!currentDoc && path().indexOf('demo')" ng-repeat="doc in currentComponent.docs" ng-href="#{{doc.url}}" aria-label="{{ doc | humanizeDoc }}" layout="column">
78-
{{doc | humanizeDoc | directiveBrackets}}
79-
</md-button>
80-
<md-button ng-if="currentDoc" ng-href="#/demo/{{currentComponent.name}}" style="position: relative; padding-left: 30px; margin-right: 15px;">
78+
79+
<div ng-repeat="doc in currentComponent.docs">
80+
<md-button ng-href="#{{doc.url}}"
81+
ng-class="{hide: path().indexOf('demo') == -1}"
82+
aria-label="{{ doc | humanizeDoc }}">
83+
{{doc | humanizeDoc | directiveBrackets}}
84+
</md-button>
85+
</div>
86+
87+
<md-button ng-class="{hide: !currentDoc}"
88+
ng-href="#/demo/{{currentComponent.name}}"
89+
style="position: relative; padding-left: 30px; margin-right: 15px;">
8190
<md-icon icon="/img/icons/ic_play_arrow_24px.svg" style="
8291
height: 28px;
8392
position: absolute;
8493
left: 0px;
8594
top: -3px;"></md-icon>
8695
<span>View Demo</span>
8796
</md-button>
88-
<md-button ng-if="currentDoc" ng-href="{{currentDoc.githubUrl}}" style="position: relative; padding-left: 30px; margin-right: 15px;">
97+
98+
<md-button ng-class="{hide: !currentDoc}"
99+
ng-href="{{currentDoc.githubUrl}}"
100+
style="position: relative; padding-left: 30px; margin-right: 15px;">
89101
<md-icon icon="/img/icons/ic_launch_24px.svg" style="
90102
height: 28;
91103
position: absolute;
@@ -94,7 +106,11 @@ <h1 class="md-toolbar-tools" flex layout="column">
94106
<span hide-sm>View on Github</span>
95107
<span hide show-sm>Source</span>
96108
</md-button>
97-
<md-button ng-if="currentDoc" ng-href="{{currentDoc.githubEditUrl}}" hide-sm style="position: relative; padding-left: 30px;">
109+
110+
<md-button ng-class="{hide: !currentDoc}"
111+
ng-href="{{currentDoc.githubEditUrl}}"
112+
hide-sm
113+
style="position: relative; padding-left: 30px;">
98114
<md-icon icon="/img/icons/ic_launch_24px.svg" style="
99115
height: 28;
100116
position: absolute;

0 commit comments

Comments
 (0)