summaryrefslogtreecommitdiff
path: root/addons/web_mobile/static/src/js/chrome_mobile.js
diff options
context:
space:
mode:
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>2011-09-08 18:03:35 +0530
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>2011-09-08 18:03:35 +0530
commitee454617c7c27227d7c6fb02ecc622c5ec896dfa (patch)
treefe2f055f1162e2d4fe68a6b6c1caf1f0334881c8 /addons/web_mobile/static/src/js/chrome_mobile.js
parent5d561e0cf6e46029318312d8e110424b65dec722 (diff)
[IMP] Dynamically listview with theme.
bzr revid: bth@tinyerp.com-20110908123335-mdd0o4hbq9c97wwm
Diffstat (limited to 'addons/web_mobile/static/src/js/chrome_mobile.js')
-rw-r--r--addons/web_mobile/static/src/js/chrome_mobile.js60
1 files changed, 29 insertions, 31 deletions
diff --git a/addons/web_mobile/static/src/js/chrome_mobile.js b/addons/web_mobile/static/src/js/chrome_mobile.js
index caf4da7e9e6..2b9d8600fef 100644
--- a/addons/web_mobile/static/src/js/chrome_mobile.js
+++ b/addons/web_mobile/static/src/js/chrome_mobile.js
@@ -114,15 +114,6 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
this.rpc('/web/session/sc_list',{} ,function(res){
self.$element.html(QWeb.render("Shortcuts", {'sc' : res}))
self.$element.find('#content').find("a").click(self.on_clicked);
- self.$element.find("#header").find('#application').click(function(){
- if(!$('#oe_menu').html().length){
- this.menu = new openerp.web_mobile.Menu(self, "oe_menu");
- this.menu.start();
- }
- else{
- self.$element.find("#header").find('#application').attr('href','#oe_menu');
- }
- });
self.$element.find("#footer").find('#preference').click(function(){
if(!$('#oe_options').html().length){
this.options = new openerp.web_mobile.Options(self, "oe_options");
@@ -195,10 +186,20 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({
.removeClass("login_valid")
.addClass("secondary_menu");
//.hide();
-// this.header = new openerp.web_mobile.Header(this, "oe_header");
- this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu", this.children);
-// this.header.start();
- this.secondary.start();
+ if(!$('#oe_sec_menu').html().length){
+ this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu", this.children);
+ this.secondary.start();
+ }else{
+ this.$element.find("#content").find('a').attr('href','#oe_sec_menu');
+ }
+ /*if(!$('#oe_sec_menu').html().length){
+ this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu", this.children);
+ this.secondary.start();
+ }else{
+ // self.$element.find("#content").find('a').attr('href','#oe_sec_menu');
+ this.$element.add(this.$secondary_menu).find("#content").find('a').attr('href','#oe_sec_menu');
+ }*/
+
}
});
openerp.web_mobile.Secondary = openerp.web.Widget.extend({
@@ -208,19 +209,25 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({
},
start: function(ev, id) {
var self = this;
+ // console.log(this.data,this.$element.html().length);
+
+ /* if(this.$element.html().length){
+ self.$element.find('[data-role="listview"]').remove();
+
+ _.each(self.data.children,function(i){
+ var newul = '<ul data-dividertheme="b" class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-theme="c" data-inset="true" data-role="listview"><li data-role="list-divider">'+
+ i.name+'</li></ul>'; // Create New List Item
+ self.$element.find('#content').append(newul);
+ //console.log('in for loop',i.children);
+ });
+ console.log('saaasasaaa',self.$element.find('#content'),self.data);
+ //self.$element.find('[data-role="listview"]').listview('refresh');
+ }else{*/
+
var v = { menu : this.data };
this.$element.html(QWeb.render("Menu.secondary", v));
this.$element.find("#header").find("h1").html(this.data.name);
this.$element.add(this.$secondary_menu).find('#content').find("a").click(this.on_menu_click);
- this.$element.find("#header").find('#application').click(function(){
- if(!$('#oe_menu').html().length){
- this.menu = new openerp.web_mobile.Menu(self, "oe_menu");
- this.menu.start();
- }
- else{
- self.$element.find("#header").find('#application').attr('href','#oe_menu');
- }
- });
this.$element.find("#footer").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts");
@@ -256,15 +263,6 @@ openerp.web_mobile.Options = openerp.web.Widget.extend({
start: function() {
var self = this;
this.$element.html(QWeb.render("Options", this));
- this.$element.find("#header").find('#application').click(function(){
- if(!$('#oe_menu').html().length){
- this.menu = new openerp.web_mobile.Menu(self, "oe_menu");
- this.menu.start();
- }
- else{
- self.$element.find("#header").find('#application').attr('href','#oe_menu');
- }
- });
this.$element.find("#footer").find('#shrotcuts').click(function(){
if(!$('#oe_shortcuts').html().length){
this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts");