diff --git a/addons/web_mobile/static/src/js/chrome_mobile.js b/addons/web_mobile/static/src/js/chrome_mobile.js index 3427c0dcdaa..d3e69027b9e 100644 --- a/addons/web_mobile/static/src/js/chrome_mobile.js +++ b/addons/web_mobile/static/src/js/chrome_mobile.js @@ -33,20 +33,16 @@ openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({ openerp.web_mobile.Login = openerp.web.Widget.extend({ start: function() { - this.has_local_storage = typeof(localStorage) != 'undefined'; this.remember_creditentials = true; this.selected_login = null; this.selected_password = null; - if (this.has_local_storage && this.remember_creditentials) { this.selected_login = localStorage.getItem('last_login_login_success'); this.selected_password = localStorage.getItem('last_password_login_success'); } - var self = this; jQuery("#oe_header").children().remove(); - this.rpc("/web/database/get_list", {}, function(result) { self.db_list = result.db_list; self.$element.html(QWeb.render("Login", self)); @@ -66,7 +62,6 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({ var db = $e.find("div select[name=database]").val(); var login = $e.find("div input[name=login]").val(); var password = $e.find("div input[name=password]").val(); - //$e.hide(); // Should hide then call callback this.session.session_login(db, login, password, function() { @@ -116,6 +111,7 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({ }); } }); + openerp.web_mobile.Header = openerp.web.Widget.extend({ init: function(session, element_id) { this._super(session, element_id); @@ -142,7 +138,6 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({ var self = this; this.rpc('/web/session/sc_list',{} ,function(res){ self.$element.html(QWeb.render("Shortcuts", {'sc' : res})) - 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", false, true); @@ -167,7 +162,6 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({ $shortcut = $(ev.currentTarget); id = $shortcut.data('menu'); res_id = $shortcut.data('res'); - if(!$('[id^="oe_list_'+res_id+'"]').html()){ $('
').appendTo('#moe'); this.listview = new openerp.web_mobile.ListView(self, "oe_list_"+res_id, res_id); @@ -198,7 +192,6 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({ this.header.start(); this.footer = new openerp.web_mobile.Footer(this, "oe_footer"); this.footer.start(); - this.$element.html(QWeb.render("Menu", this.data)); this.$element.find("[data-role=header]").find('h1').html('Application'); this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ @@ -235,7 +228,6 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({ this.$element .removeClass("login_valid") .addClass("secondary_menu"); - if(!$('[id^="oe_sec_menu_'+id+'"]').html()){ $('
').appendTo('#moe'); this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu_"+id, this.children); @@ -245,6 +237,7 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({ } } }); + openerp.web_mobile.Secondary = openerp.web.Widget.extend({ init: function(session, element_id, secondary_menu_id) { this._super(session, element_id); @@ -287,23 +280,23 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({ ev.stopPropagation(); var child_len = 0; for (var i = 0; i < this.data.children.length; i++) { - for (var j=0; j < this.data.children[i].children.length; j++) { - if (this.data.children[i].children[j].id == id) { - this.children = this.data.children[i].children[j]; - child_len = this.children.children.length; - } - } + for (var j=0; j < this.data.children[i].children.length; j++) { + if (this.data.children[i].children[j].id == id) { + this.children = this.data.children[i].children[j]; + child_len = this.children.children.length; + } + } } if (child_len > 0) { this.$element .addClass("secondary_menu"); - if(!$('[id^="oe_sec_menu_'+id+'"]').html()){ - $('
').appendTo('#moe'); - this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu_"+id, this.children); - this.secondary.start(); - }else{ - $.mobile.changePage('#oe_sec_menu_'+id, "slide", false, true); - } + if(!$('[id^="oe_sec_menu_'+id+'"]').html()){ + $('
').appendTo('#moe'); + this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu_"+id, this.children); + this.secondary.start(); + }else{ + $.mobile.changePage('#oe_sec_menu_'+id, "slide", false, true); + } } else { if(!$('[id^="oe_list_'+id+'"]').html()){ @@ -314,13 +307,6 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({ $.mobile.changePage('#oe_list_'+id, "slide", false, true); } } -/* if(!$('[id^="oe_list_'+id+'"]').html()){ - $('
').appendTo('#moe'); - this.listview = new openerp.web_mobile.ListView(this, "oe_list_"+id, id); - this.listview.start(); - }else{ - $.mobile.changePage('#oe_list_'+id, "slide", false, true); - }*/ jQuery("#oe_header").find("h1").html($menu.data('name')); } }); @@ -328,7 +314,6 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({ openerp.web_mobile.Options = openerp.web.Widget.extend({ start: function() { var self = this; - this.$element.html(QWeb.render("Options", this)); this.$element.find("[data-role=header]").find('h1').html('Preference'); this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js index bc52a3a21ae..cd52ac8b7c4 100644 --- a/addons/web_mobile/static/src/js/form_mobile.js +++ b/addons/web_mobile/static/src/js/form_mobile.js @@ -12,23 +12,19 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ this.head_title = head_title; this.resmodel = resmodel; this.viewid = viewid; - }, start: function() { var self = this; var id = this.list_id; - var model = this.action.res_model || this.resmodel; if(this.action){ var view_id = this.action.views[1][0]; }else{ var view_id = this.viewid; } - this.dataset = new openerp.web.DataSetSearch(this, model, null, null); var context = new openerp.web.CompoundContext(this.dataset.get_context()); this.dataset.read_slice([],{}, function (result) { - for (var i = 0; i < result.length; i++) { if (result[i].id == id) { var data = result[i]; @@ -44,216 +40,211 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ } } self.$element.html(QWeb.render("FormView", {'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : fields, 'values' : data ,'temp_flag':'1'})); - for(var i=0;i ').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); } - else{ - $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(i){ + for (var k = 0; k < notebooks.children.length; k++) { + if (notebooks.children[k].attrs.string == $(this).attr('id')) { + get_fields = self.get_fields(notebooks.children[k].children); + for (var i = 0; i < get_fields.length; i++) { + if (fields[get_fields[i].attrs.name].type == 'one2many'){ + self.relational_fields = get_fields[i].attrs.name; + if(fields[get_fields[i].attrs.name].views.form){ + var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); + var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; + var notebook=fields[get_fields[i].attrs.name].views.form.arch; + } + } + } } - }); - self.$element.find("[data-role=footer]").find('#preference').click(function(){ - if(!$('#oe_options').html().length){ - this.options = new openerp.web_mobile.Options(self, "oe_options"); - this.options.start(); + if(notebook){ + $(this).find('p').html(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data,'til': notebook.attrs.string })); + }else{ + $(this).find('p').html(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data })); } - else{ - $.mobile.changePage("#oe_options", "slide", false, true); - } - }); - self.$element.find('#formbutton').click(function(){ - var head = $(this).prev().find('select').find("option:selected").text(); - var selected_id = $(this).prev().find('select').val(); - var select_model = $(this).prev().find('select').attr('for'); - if(selected_id!="false"){ - if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ - $('
').appendTo('#moe'); + $(this).find('p').find('#formbutton').click(function(){ + var head = $(this).prev().find('select').find("option:selected").text(); + var selected_id = $(this).prev().find('select').val(); + var select_model = $(this).prev().find('select').attr('for'); + if(selected_id!="false"){ + if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ + $('
').appendTo('#moe'); this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); this.formview.start(); - }else{ - $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); - } - } - }); - self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(i){ - - for (var k = 0; k < notebooks.children.length; k++) { - if (notebooks.children[k].attrs.string == $(this).attr('id')) { - get_fields = self.get_fields(notebooks.children[k].children); - for (var i = 0; i < get_fields.length; i++) { - if (fields[get_fields[i].attrs.name].type == 'one2many'){ - self.relational_fields = get_fields[i].attrs.name; - if(fields[get_fields[i].attrs.name].views.form){ - var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); - var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; - var notebook=fields[get_fields[i].attrs.name].views.form.arch; - } - } + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); } } - if(notebook){ - $(this).find('p').html(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data,'til': notebook.attrs.string })); - }else{ - $(this).find('p').html(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data })); - } - $(this).find('p').find('#formbutton').click(function(){ - var head = $(this).prev().find('select').find("option:selected").text(); - var selected_id = $(this).prev().find('select').val(); - var select_model = $(this).prev().find('select').attr('for'); - if(selected_id!="false"){ - if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ - $('
').appendTo('#moe'); - this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); - this.formview.start(); - }else{ - $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); - } - } - }); - - } - }); - self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').find('p').find('[data-role=content]').find('ul').find('li').click(function(ev){ - ev.preventDefault(); - ev.stopPropagation(); - var latid,lastid; - $(this).parents().each(function(){ - latid = $(this).attr('id'); - self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(){ - if(latid==$(this).attr('id')){ - lastid = $(this).attr('id'); - } - }); }); - var relational = $(this).attr('for'); - if(result.fields[relational]){ - var head = $.trim($(this).text()); - var dataset = new openerp.web.DataSetStatic(self, result.fields[relational].relation, result.fields[relational].context); - dataset.domain=[['id', 'in', data[relational]]]; - dataset.name_search('', dataset.domain, 'in',false ,function(res){ - for(var i=0;i ').appendTo('#moe'); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html(QWeb.render("ListView", {'records' : res})); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('h1').html(head); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('#home').click(function(){ - $.mobile.changePage("#oe_menu", "slide", false, true); - }); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ - if(!$('#oe_shortcuts').html().length){ - this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); - this.shortcuts.start(); - } - else{ - $.mobile.changePage("#oe_shortcuts", "slide", false, true); - } - }); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#preference').click(function(){ - if(!$('#oe_options').html().length){ - this.options = new openerp.web_mobile.Options(self, "oe_options"); - this.options.start(); - } - else{ - $.mobile.changePage("#oe_options", "slide", false, true); - } - }); - $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("a#list-id").click(function(ev){ - ev.preventDefault(); - ev.stopPropagation(); - var head_title = $(this).text(); - var listid = $(ev.currentTarget).data('id'); - dataset = new openerp.web.DataSetSearch(self, dataset.model, null, null); - dataset.read_slice([],{}, function (result_relational) { - for (var i = 0; i < result_relational.length; i++) { - if (result_relational[i].id == listid) { - var data_relational = result_relational[i]; - } + } + }); + self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').find('p').find('[data-role=content]').find('ul').find('li').click(function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + var latid,lastid; + $(this).parents().each(function(){ + latid = $(this).attr('id'); + self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(){ + if(latid==$(this).attr('id')){ + lastid = $(this).attr('id'); + } + }); + }); + var relational = $(this).attr('for'); + if(result.fields[relational]){ + var head = $.trim($(this).text()); + var dataset = new openerp.web.DataSetStatic(self, result.fields[relational].relation, result.fields[relational].context); + dataset.domain=[['id', 'in', data[relational]]]; + dataset.name_search('', dataset.domain, 'in',false ,function(res){ + for(var i=0;i ').appendTo('#moe'); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html(QWeb.render("ListView", {'records' : res})); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('h1').html(head); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ + if(!$('#oe_shortcuts').html().length){ + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + } + else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#preference').click(function(){ + if(!$('#oe_options').html().length){ + this.options = new openerp.web_mobile.Options(self, "oe_options"); + this.options.start(); + } + else{ + $.mobile.changePage("#oe_options", "slide", false, true); + } + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("a#list-id").click(function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + var head_title = $(this).text(); + var listid = $(ev.currentTarget).data('id'); + dataset = new openerp.web.DataSetSearch(self, dataset.model, null, null); + dataset.read_slice([],{}, function (result_relational) { + for (var i = 0; i < result_relational.length; i++) { + if (result_relational[i].id == listid) { + var data_relational = result_relational[i]; } - if(!$('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html()){ - $('
').appendTo('#moe'); - for (var k = 0; k < notebooks.children.length; k++) { - if (notebooks.children[k].attrs.string == lastid) { - get_fields = self.get_fields(notebooks.children[k].children); - for (var i = 0; i < get_fields.length; i++) { - if (fields[get_fields[i].attrs.name].type == 'one2many'){ - self.relational_fields = get_fields[i].attrs.name; - if(fields[get_fields[i].attrs.name].views.form){ - var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); - var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; - var notebook=fields[get_fields[i].attrs.name].views.form.arch; - } + } + if(!$('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html()){ + $('
').appendTo('#moe'); + for (var k = 0; k < notebooks.children.length; k++) { + if (notebooks.children[k].attrs.string == lastid) { + get_fields = self.get_fields(notebooks.children[k].children); + for (var i = 0; i < get_fields.length; i++) { + if (fields[get_fields[i].attrs.name].type == 'one2many'){ + self.relational_fields = get_fields[i].attrs.name; + if(fields[get_fields[i].attrs.name].views.form){ + var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); + var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; + var notebook=fields[get_fields[i].attrs.name].views.form.arch; } } } } - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html(QWeb.render("FormView", {'get_fields': get_fields_test, 'notebooks': false, 'fields' : fields_test, 'values' : data_relational, 'temp_flag':'1' })); - - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('h1').html(head_title); - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('#home').click(function(){ - $.mobile.changePage("#oe_menu", "slide", false, true); - }); - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ - if(!$('#oe_shortcuts').html().length){ - this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); - this.shortcuts.start(); - } - else{ - $.mobile.changePage("#oe_shortcuts", "slide", false, true); - } - }); - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#preference').click(function(){ - if(!$('#oe_options').html().length){ - this.options = new openerp.web_mobile.Options(self, "oe_options"); - this.options.start(); - } - else{ - $.mobile.changePage("#oe_options", "slide", false, true); - } - }); - $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find('#formbutton').click(function(){ - var head = $(this).prev().find('select').find("option:selected").text(); - var selected_id = $(this).prev().find('select').val(); - var select_model = $(this).prev().find('select').attr('for'); - if(selected_id!="false"){ - if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ - $('
').appendTo('#moe'); - this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); - this.formview.start(); - }else{ - $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); - } - } - }); - $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); - }else{ - $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); } - }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html(QWeb.render("FormView", {'get_fields': get_fields_test, 'notebooks': false, 'fields' : fields_test, 'values' : data_relational, 'temp_flag':'1' })); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('h1').html(head_title); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ + if(!$('#oe_shortcuts').html().length){ + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + } + else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#preference').click(function(){ + if(!$('#oe_options').html().length){ + this.options = new openerp.web_mobile.Options(self, "oe_options"); + this.options.start(); + } + else{ + $.mobile.changePage("#oe_options", "slide", false, true); + } + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find('#formbutton').click(function(){ + var head = $(this).prev().find('select').find("option:selected").text(); + var selected_id = $(this).prev().find('select').val(); + var select_model = $(this).prev().find('select').attr('for'); + if(selected_id!="false"){ + if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ + $('
').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); + } + } + }); + $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); + }else{ + $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); + } }); - $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); - }else{ - $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); - } - }); - } - }); - $.mobile.changePage("#"+self.element_id, "slide", false, true); + }); + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + }else{ + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + } + }); + } }); + $.mobile.changePage("#"+self.element_id, "slide", false, true); + }); }); }, get_fields: function(view_fields, fields) { @@ -269,4 +260,5 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ return this.fields; } }); + }; diff --git a/addons/web_mobile/static/src/js/list_mobile.js b/addons/web_mobile/static/src/js/list_mobile.js index e4498ccbdd5..778d0a568d3 100644 --- a/addons/web_mobile/static/src/js/list_mobile.js +++ b/addons/web_mobile/static/src/js/list_mobile.js @@ -10,8 +10,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ this.list_id = list_id; }, start: function() { - this.rpc('/web/menu/action', {'menu_id': this.list_id}, - this.on_menu_action_loaded); + this.rpc('/web/menu/action', {'menu_id': this.list_id}, this.on_menu_action_loaded); }, on_menu_action_loaded: function(data) { var self = this; @@ -30,11 +29,10 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ $.mobile.changePage("#oe_menu", "slide", false, true); }); self.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ - if(!$('#oe_shortcuts').html().length){ + if (!$('#oe_shortcuts').html().length) { this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); this.shortcuts.start(); - } - else{ + }else{ $.mobile.changePage("#oe_shortcuts", "slide", false, true); } }); @@ -42,8 +40,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ if(!$('#oe_options').html().length){ this.options = new openerp.web_mobile.Options(self, "oe_options"); this.options.start(); - } - else{ + }else{ $.mobile.changePage("#oe_options", "slide", false, true); } }); @@ -58,7 +55,6 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ ev.stopPropagation(); id = $record.data('id'); head_title = $.trim($record.text()); - if(!$('[id^="oe_form_'+id+this.action.res_model+'"]').html()){ $('
').appendTo('#moe'); this.formview = new openerp.web_mobile.FormView(this, "oe_form_"+id+this.action.res_model, id, this.action, head_title, '' ,''); diff --git a/addons/web_mobile/static/src/xml/web_mobile.xml b/addons/web_mobile/static/src/xml/web_mobile.xml index d2df9a1fed9..977057c11f1 100644 --- a/addons/web_mobile/static/src/xml/web_mobile.xml +++ b/addons/web_mobile/static/src/xml/web_mobile.xml @@ -41,7 +41,6 @@

Powered by openerp.com

- @@ -75,6 +74,7 @@ +
@@ -95,19 +95,19 @@
+
@@ -141,11 +142,11 @@
+ -
@@ -181,19 +182,18 @@ : -
+
-
+
- +
-
- +
-

- -

-

+

-

- -

-

+