1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-21 23:08:50 -05:00

went vmousedown for all items instead of scrollable lists

This commit is contained in:
Tankred Hase 2013-03-14 21:21:16 +01:00
parent efa385c063
commit 6accc270f4
2 changed files with 18 additions and 17 deletions

View File

@ -11,7 +11,6 @@ var AppRouter = Backbone.Router.extend({
},
initialize: function () {
this.firstPage = true;
},
login: function() {
@ -28,10 +27,8 @@ var AppRouter = Backbone.Router.extend({
},
compose: function() {
// $.mobile.defaultPageTransition = 'slideup';
var composeView = new app.view.ComposeView();
this.changePage(composeView);
// $.mobile.defaultPageTransition = 'slideup';
},
folders: function(userId) {
@ -64,25 +61,19 @@ var AppRouter = Backbone.Router.extend({
$('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
var transition = $.mobile.defaultPageTransition;
// We don't want to slide the first page
if (this.firstPage) {
transition = 'none';
this.firstPage = false;
}
$.mobile.changePage(pageEl, {changeHash:false, transition:transition, reverse:this.back});
// change page for link buttons on vmousedown instead of waiting on vmouseup
pageEl.on('vmousedown', 'a[data-role="button"]', function(e) {
e.preventDefault();
var href = $(e.currentTarget).attr('href');
window.location = href;
});
// change transition direction back after back button was pushed
this.back = false;
// $.mobile.defaultPageTransition = 'fade';
$.mobile.changePage(pageEl, {changeHash:false, reverse:false});
}
});

View File

@ -7,7 +7,17 @@ app.view.FolderListView = Backbone.View.extend({
},
render:function (eventName) {
$(this.el).html(this.template(this.options));
var page = $(this.el);
page.html(this.template(this.options));
// change page for folder links on vmousedown instead of waiting on vmouseup
page.on('vmousedown', 'li a', function(e) {
e.preventDefault();
var href = $(e.currentTarget).attr('href');
window.location = href;
});
return this;
}
});