Skip to content

Commit

Permalink
+ Gallery screen
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Apr 10, 2014
1 parent ff6c4af commit 8ee6806
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tutorial/11-jquery-requirejs-finally/app.js
Expand Up @@ -9,11 +9,11 @@
id: 'home',

/**
* This method should be called before `init`, `routestart` or `routechange`
* This method should be called once before `init`, `routestart` or `routechange`
* @param {Pilot.Request} req
* @returns {$.Deferred}
*/
loadData: function (req) {
loadDataOnce: function (req) {
return $.getJSON('./data/galleries.json');
},

Expand All @@ -33,6 +33,21 @@
return '<li class="table-view-cell"><a href="'+url+'">'+name+'</a></li>';
}, this));
}
},


// Gallery screen
'/gallery/:name/': {
id: 'gallery',

/**
* Is similar to `routestart` and `routechange`.
* @param {$.Event} evt
* @param {Pilot.Request} req
*/
onRoute: function (evt, req) {
this.$('.title').text(req.params.name);
}
}


Expand All @@ -42,3 +57,4 @@
// Run app
App.start('/');
})(jQuery, Pilot);

17 changes: 17 additions & 0 deletions tutorial/11-jquery-requirejs-finally/index.html
Expand Up @@ -34,6 +34,23 @@ <h1 class="js-title title"></h1>
</div>
<!-- /Home -->

<!-- Gallery -->
<div data-view-id="gallery" style="z-index: 2; display: none;">
<header class="bar bar-nav">
<a href="#!/" class="btn btn-link btn-nav pull-left">
<span class="icon icon-left-nav"></span>
Home
</a>
<h1 class="js-title title"></h1>
</header>

<div class="js-content content">
<div class="js-photos photos"></div>
<div class="js-paginator paginator"></div>
</div>
</div>
<!-- /Gallery -->

</div>


Expand Down

0 comments on commit 8ee6806

Please sign in to comment.