From e8a2fda06eb1a2d424164897dd082067ae9b3047 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 22 Mar 2012 14:59:25 +0530 Subject: [PATCH] list button-group one more time --- js/all-app.js | 6 +++--- js/all-web.js | 8 ++++---- version.num | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/all-app.js b/js/all-app.js index a79741b711..0772a954c3 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -263,7 +263,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ \ \
\ -
\ +
\ \ Refresh\ \ @@ -293,7 +293,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();} if(!me.show_filters){this.$w.find('.btn-filter').remove();} if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} -this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(this).outerWidth();});this.$w.find('.list-toolbar').css('width',(w+10)+'px');} +this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(e).outerWidth();});} if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function') this.onrun=a0;if(a0&&a0.callback) this.onrun=a0.callback;if(!a1&&!(a0&&a0.append)) @@ -1816,7 +1816,7 @@ _f.SectionBreak.prototype.has_data=function(){var me=this;for(var i in me.fields if(f.df.reqd&&!v){return true;} if(f.df.fieldtype=='Table'){if(f.grid.get_children().length||f.df.reqd){return true;}}} return false;} -_f.SectionBreak.prototype.refresh=function(from_form){if(this.df.hidden){if(this.row)this.row.hide();}else{if(this.collapsible){if(this.has_data()){this.section_expand(from_form);}else{this.section_collapse();}}}} +_f.SectionBreak.prototype.refresh=function(from_form){if(this.df.hidden){if(this.row)this.row.hide();}else{if(this.collapsible){if(this.df.reqd||this.has_data()){this.section_expand(from_form);}else{this.section_collapse();}}}} _f.ImageField=function(){this.images={};} _f.ImageField.prototype=new Field();_f.ImageField.prototype.onmake=function(){this.no_img=$a(this.wrapper,'div','no_img');this.no_img.innerHTML="No Image";$dh(this.no_img);} _f.ImageField.prototype.get_image_src=function(doc){if(doc.file_list){file=doc.file_list.split(',');extn=file[0].split('.');extn=extn[extn.length-1].toLowerCase();var img_extn_list=['gif','jpg','bmp','jpeg','jp2','cgm','ief','jpm','jpx','png','tiff','jpe','tif'];if(in_list(img_extn_list,extn)){var src=wn.request.url+"?cmd=downloadfile&file_id="+file[1];}}else{var src="";} diff --git a/js/all-web.js b/js/all-web.js index d1b5b18573..48fea5a37d 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -177,7 +177,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
\ \
\ -
\ +
\ \ Refresh\ \ @@ -207,7 +207,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();} if(!me.show_filters){this.$w.find('.btn-filter').remove();} if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} -this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(this).outerWidth();});this.$w.find('.list-toolbar').css('width',(w+10)+'px');} +this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(e).outerWidth();});} if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function') this.onrun=a0;if(a0&&a0.callback) this.onrun=a0.callback;if(!a1&&!(a0&&a0.append)) @@ -901,7 +901,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
\ \
\ -
\ +
\ \ Refresh\ \ @@ -931,7 +931,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();} if(!me.show_filters){this.$w.find('.btn-filter').remove();} if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} -this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(this).outerWidth();});this.$w.find('.list-toolbar').css('width',(w+10)+'px');} +this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){var w=0;this.$w.find('.list-toolbar a').each(function(i,e){w+=$(e).outerWidth();});} if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function') this.onrun=a0;if(a0&&a0.callback) this.onrun=a0.callback;if(!a1&&!(a0&&a0.append)) diff --git a/version.num b/version.num index 777d295183..6794342e57 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -1387 \ No newline at end of file +1393 \ No newline at end of file