Skip to content

Commit

Permalink
progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
danwilson committed Mar 7, 2014
1 parent ea81da7 commit f1fb18b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Responsive/Responsive/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ body {
background: #fdfdff url(../images/win8talk.png) left top no-repeat;
}

progress {
width: 100%;
position:absolute;
top: 1rem;
left: 0;
}
progress.inactive {
display: none;
}

#contenthost {
height: 100%;
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions Responsive/Responsive/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<script src="/js/SelectableList.js"></script>
</head>
<body>
<progress></progress>
<div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/pages/groupedItems/groupedItems.html'}"></div>
<div id="appbar" data-win-control="WinJS.UI.AppBar">
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'refreshCommand', label:'Refresh', icon:'refresh'}" type="button"></button>
Expand Down
1 change: 1 addition & 0 deletions Responsive/Responsive/js/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@

_navigated: function () {
this.pageElement.style.visibility = "";
document.querySelector('progress').classList.add('inactive');
WinJS.UI.Animation.enterPage(this._getAnimationElements()).done();
},

Expand Down
3 changes: 2 additions & 1 deletion Responsive/Responsive/pages/author/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

// This function is called whenever a user navigates to this page.
ready: function (element, options) {
document.querySelector('progress').classList.remove('inactive');
this.element.querySelector(".titlearea .pagetitle").textContent = options.name;
this.listView = document.querySelector('.groupeditemslist').winControl;
this.listView.addEventListener('iteminvoked', this._itemInvoked.bind(this));
Expand Down Expand Up @@ -69,7 +70,7 @@
nav.navigate("/pages/itemDetail/itemDetail.html", { item: item });
},
stopProgress: function () {

document.querySelector('progress').classList.add('inactive');
},
getGroupKey: function (data) {
return data.group;
Expand Down
6 changes: 2 additions & 4 deletions Responsive/Responsive/pages/groupedItems/groupedItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,15 @@
},

updateLayout: function (element) {
/// <param name="element" domElement="true" />
document.querySelector('.groupeditemslist').winControl.recalculateItemPosition();
// TODO: Respond to changes in layout.
element.querySelector('.groupeditemslist').winControl.recalculateItemPosition();
},

_itemInvoked: function (args) {
var item = this.groupedItems.getAt(args.detail.itemIndex);
nav.navigate("/pages/itemDetail/itemDetail.html", { item: item });
},
stopProgress: function () {

document.querySelector('progress').classList.add('inactive');
},
compareGroups: function (a, b) {
return a - b;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// This function is called whenever a user navigates to this page.
ready: function (element, options) {
this.element = element;
document.querySelector('progress').classList.remove('inactive');
this.pastries.done(function (resp) {
this.stopProgress();
if (resp && resp.response && resp.response.length) {
Expand Down

0 comments on commit f1fb18b

Please sign in to comment.