mirror of https://github.com/moparisthebest/mail
cleanup
This commit is contained in:
parent
de6d7f9965
commit
4a09a6da60
|
@ -11,13 +11,6 @@ var AppRouter = Backbone.Router.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
// handle back click
|
|
||||||
var self = this;
|
|
||||||
$(document).on('vmousedown', '#backBtn', function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
self.back = true;
|
|
||||||
window.history.back();
|
|
||||||
});
|
|
||||||
this.firstPage = true;
|
this.firstPage = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -65,9 +58,18 @@ var AppRouter = Backbone.Router.extend({
|
||||||
|
|
||||||
changePage: function (page) {
|
changePage: function (page) {
|
||||||
// render the page and append it to the DOM
|
// render the page and append it to the DOM
|
||||||
$(page.el).attr('data-role', 'page');
|
var pageEl = $(page.el);
|
||||||
|
pageEl.attr('data-role', 'page');
|
||||||
page.render();
|
page.render();
|
||||||
$('body').append($(page.el));
|
$('body').append(pageEl);
|
||||||
|
|
||||||
|
// handle back click
|
||||||
|
var self = this;
|
||||||
|
pageEl.on('vmousedown', '#backBtn', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
self.back = true;
|
||||||
|
window.history.back();
|
||||||
|
});
|
||||||
|
|
||||||
// change to the page using jQM transitions
|
// change to the page using jQM transitions
|
||||||
var transition = $.mobile.defaultPageTransition;
|
var transition = $.mobile.defaultPageTransition;
|
||||||
|
@ -76,7 +78,7 @@ var AppRouter = Backbone.Router.extend({
|
||||||
transition = 'none';
|
transition = 'none';
|
||||||
this.firstPage = false;
|
this.firstPage = false;
|
||||||
}
|
}
|
||||||
$.mobile.changePage($(page.el), {changeHash:false, transition:transition, reverse:this.back});
|
$.mobile.changePage(pageEl, {changeHash:false, transition:transition, reverse:this.back});
|
||||||
|
|
||||||
// change transition direction back after back button was pushed
|
// change transition direction back after back button was pushed
|
||||||
this.back = false;
|
this.back = false;
|
||||||
|
|
Loading…
Reference in New Issue