diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index 61c0ef20ff..c4ef9da111 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -313,31 +313,11 @@ _f.Frm.prototype.setup_footer = function() { } _f.Frm.prototype.set_intro = function(txt) { - if(!this.intro_area) { - this.intro_area = $('
') - .insertBefore(this.page_layout.body.firstChild); - } - if(txt) { - if(txt.search(/

/)==-1) txt = '

' + txt + '

'; - this.intro_area.html(txt); - } else { - this.intro_area.remove(); - this.intro_area = null; - } + wn.utils.set_intro(this, this.page_layout.body, txt); } _f.Frm.prototype.set_footnote = function(txt) { - if(!this.footnote_area) { - this.footnote_area = $('
') - .insertAfter(this.page_layout.body.lastChild); - } - if(txt) { - if(txt.search(/

/)==-1) txt = '

' + txt + '

'; - this.footnote_area.html(txt); - } else { - this.footnote_area.remove(); - this.footnote_area = null; - } + wn.utils.set_footnote(this, this.page_layout.body, txt); } @@ -350,7 +330,7 @@ _f.Frm.prototype.setup_fields_std = function() { this.layout.addrow(); // default section break if(fl[0].fieldtype!="Column Break") {// without column too var c = this.layout.addcell(); - $y(c.wrapper, {padding: '8px'}); + $y(c.wrapper, {padding: '8px'}); } } diff --git a/public/js/wn/misc/utils.js b/public/js/wn/misc/utils.js index 1f3a2d87c5..683d80a690 100644 --- a/public/js/wn/misc/utils.js +++ b/public/js/wn/misc/utils.js @@ -50,5 +50,32 @@ wn.utils = { } else { return list; } - } + }, + set_intro: function(me, wrapper, txt) { + if(!me.intro_area) { + me.intro_area = $('
') + .insertBefore(wrapper.firstChild); + } + if(txt) { + if(txt.search(/

/)==-1) txt = '

' + txt + '

'; + me.intro_area.html(txt); + } else { + me.intro_area.remove(); + me.intro_area = null; + } + }, + set_footnote: function(me, wrapper, txt) { + if(!me.footnote_area) { + me.footnote_area = $('
') + .insertAfter(wrapper.lastChild); + } + + if(txt) { + if(txt.search(/

/)==-1) txt = '

' + txt + '

'; + me.footnote_area.html(txt); + } else { + me.footnote_area.remove(); + me.footnote_area = null; + } + }, } \ No newline at end of file diff --git a/public/js/wn/router.js b/public/js/wn/router.js index 77f9496c92..e74d6d1b1f 100644 --- a/public/js/wn/router.js +++ b/public/js/wn/router.js @@ -72,7 +72,7 @@ wn.get_route_str = function(route) { } wn.set_route = function() { - route = $.map(arguments, function(a) { return encodeURIComponent(a) }).join('/'); + route = $.map(arguments, function(a) { return a ? encodeURIComponent(a) : null; }).join('/'); window.location.hash = route; // Set favicon (app.js) diff --git a/public/js/wn/views/grid_report.js b/public/js/wn/views/grid_report.js index 9b8b9da3e7..b05ec906a1 100644 --- a/public/js/wn/views/grid_report.js +++ b/public/js/wn/views/grid_report.js @@ -268,7 +268,7 @@ wn.views.GridReport = Class.extend({ if (col.formatter==me.currency_formatter) { item[col.id] = 0; } - }); + }); }, refresh: function() { @@ -302,15 +302,13 @@ wn.views.GridReport = Class.extend({ // print / export $('
\ - \ - Print \ - | \ - Export \ + \ + \ + Export \
').appendTo(this.wrapper); this.wrapper.find(".grid-report-export").click(function() { return me.export(); }); - this.wrapper.find(".grid-report-print").click(function() { msgprint("Coming Soon"); return false; }); // grid wrapper this.grid_wrapper = $("