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

Commit ce73ed0

Browse files
committed
feat(docs): add "Loading..." notification
1 parent 90ac8d5 commit ce73ed0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

docs/src/templates/docs.css

+25
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@ li {
7474

7575
/*----- Global Layout -----*/
7676

77+
#loading {
78+
position: fixed;
79+
left: 50%;
80+
margin: 1.5em -40px;
81+
width: 80px;
82+
padding: 0.2em 0.2em;
83+
text-align: center;
84+
font-weight: bold;
85+
font-size: 13px;
86+
color: #FFFFFF;
87+
border: 1px solid black;
88+
background-color: #7989D6;
89+
90+
-webkit-border-radius: 2px;
91+
-moz-border-radius: 2px;
92+
border-radius: 2px;
93+
94+
-webkit-box-shadow: 0 2px 8px rgba(0,0,0,0.6);
95+
-moz-box-shadow: 0 2px 8px rgba(0,0,0,0.6);
96+
box-shadow: 0 2px 8px rgba(0,0,0,0.6);
97+
98+
z-index: 2; /* just below #fader */
99+
}
100+
101+
77102
#container {
78103
width: 1150px;
79104
margin: 0 auto;

docs/src/templates/docs.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function DocsController($location, $browser, $window, $cookies) {
1313
scope.subpage = false;
1414
scope.offlineEnabled = ($cookies[OFFLINE_COOKIE_NAME] == angular.version.full);
1515
scope.futurePartialTitle = null;
16+
scope.loading = 0;
1617

1718
if (!$location.path() || INDEX_PATH.test($location.path())) {
1819
$location.path('/api').replace();
@@ -25,6 +26,7 @@ function DocsController($location, $browser, $window, $cookies) {
2526
scope.sectionId = parts[1];
2627
scope.partialId = parts[2] || 'index';
2728
scope.pages = angular.Array.filter(NG_PAGES, {section: scope.sectionId});
29+
scope.loading++;
2830

2931
var i = scope.pages.length;
3032
while (i--) {
@@ -69,6 +71,7 @@ function DocsController($location, $browser, $window, $cookies) {
6971
};
7072

7173
scope.afterPartialLoaded = function() {
74+
scope.loading--;
7275
scope.partialTitle = scope.futurePartialTitle;
7376
SyntaxHighlighter.highlight();
7477
$window.scrollTo(0,0);

docs/src/templates/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
</ul>
112112
</div>
113113

114+
<div id="loading" ng:show="loading">Loading...</div>
115+
114116

115117
<div id="content-panel">
116118
<h2 ng:bind="partialTitle"></h2>

0 commit comments

Comments
 (0)