[MERGE] Imrpoved Back button action.

bzr revid: jra@tinyerp.com-20110921071132-e4ij5hqvzq2vkn5b
This commit is contained in:
Jiten (OpenERP) 2011-09-21 12:41:32 +05:30
parent 67353a0c10
commit b096f09505
3 changed files with 28 additions and 28 deletions

View File

@ -119,7 +119,7 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
self.$element.find("[data-role=header]").find('h1').html('Favourite');
self.$element.find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
self.$element.find('#content').find("a").click(self.on_clicked);
self.$element.find("[data-role=footer]").find('#preference').click(function(){
@ -128,10 +128,10 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
});
},
on_clicked: function(ev) {
@ -186,11 +186,11 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
this.$element.add(this.$secondary_menu).find("#content").find('a').click(this.on_menu_click);
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
},
on_menu_click: function(ev, id) {
var $menu = $(ev.currentTarget);
@ -234,7 +234,7 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
this.$element.find("[data-role=footer]").find('#preference').click(function(){
@ -243,14 +243,14 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
this.$element.find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
$.mobile.changePage($("#oe_sec_menu"), "slide", true, true);
$.mobile.changePage("#oe_sec_menu", "slide", true, true);
},
on_menu_click: function(ev, id) {
var $menu = $(ev.currentTarget);
@ -282,17 +282,17 @@ openerp.web_mobile.Options = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
this.$element.find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
this.$element.find("[data-role=content]").find('a').click(function(){
$('#oe_login').empty();
window.location.replace('/mobile');
});
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});

View File

@ -44,7 +44,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
self.$element.find("[data-role=header]").find('h1').html(self.head_title);
self.$element.find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
self.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
@ -52,7 +52,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
self.$element.find("[data-role=footer]").find('#preference').click(function(){
@ -61,7 +61,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
self.$element.find('select').change(function(ev){
@ -121,7 +121,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
$('#oe_list').html(QWeb.render("ListView", {'records' : res}));
$('#oe_list').find("[data-role=header]").find('h1').html(head);
$('#oe_list').find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
$('#oe_list').find("[data-role=footer]").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
@ -129,7 +129,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
$('#oe_list').find("[data-role=footer]").find('#preference').click(function(){
@ -138,7 +138,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
$('#oe_list').find("a#list-id").click(function(ev){
@ -174,7 +174,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
});
$('#oe_form').find("[data-role=header]").find('h1').html(head_title);
$('#oe_form').find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
$('#oe_form').find("[data-role=footer]").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
@ -182,7 +182,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
$('#oe_form').find("[data-role=footer]").find('#preference').click(function(){
@ -191,19 +191,19 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
$.mobile.changePage($("#oe_form"), "slide", true, true);
$.mobile.changePage("#oe_form", "slide", true, true);
}
});
});
$.mobile.changePage($("#oe_list"), "slide", true, true);
$.mobile.changePage("#oe_list", "slide", true, true);
}
});
}
});
$.mobile.changePage($("#oe_form"), "slide", true, true);
$.mobile.changePage("#oe_form", "slide", true, true);
});
});
},

View File

@ -27,7 +27,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({
self.$element.html(QWeb.render("ListView", {'records' : result}));
self.$element.find("[data-role=header]").find('h1').html(self.action.name);
self.$element.find("[data-role=header]").find('#home').click(function(){
$.mobile.changePage($("#oe_menu"), "slide", true, true);
$.mobile.changePage("#oe_menu", "slide", true, true);
});
self.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
@ -35,7 +35,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({
this.shortcuts.start();
}
else{
$.mobile.changePage($("#oe_shortcuts"), "slide", true, true);
$.mobile.changePage("#oe_shortcuts", "slide", true, true);
}
});
self.$element.find("[data-role=footer]").find('#preference').click(function(){
@ -44,11 +44,11 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({
this.options.start();
}
else{
$.mobile.changePage($("#oe_options"), "slide", true, true);
$.mobile.changePage("#oe_options", "slide", true, true);
}
});
self.$element.find("a#list-id").click(self.on_list_click);
$.mobile.changePage($("#oe_list"), "slide", true, true);
$.mobile.changePage("#oe_list", "slide", true, true);
});
},
on_list_click: function(ev) {