Skip to content

Instantly share code, notes, and snippets.

View CSilivestru's full-sized avatar

Chris Silivestru CSilivestru

  • Shopify
  • Kitchener, ON
View GitHub Profile
@CSilivestru
CSilivestru / back-button-detection.js
Last active December 11, 2015 10:48
Integrating Junior into your mobile web app
Jr.Navigator = {
backButtonFlag: true, //Junior manages the backButton state for us.
...
...
renderView: function(mainEl, view) {
var animation, newEl;
animation = this.history.length > 0 ? this.history[this.history.length -1].animation : null;
//In the renderView function, I've added some support here to trigger a back event if it happened. Notice thw two events.