Ver a proveniência

commonified code to set intro and footnote, removed print option from grid reports

version-14
Nabin Hait há 12 anos
ascendente
cometimento
d7663ea789
3 ficheiros alterados com 31 adições e 25 eliminações
  1. +3
    -23
      public/js/legacy/widgets/form/form.js
  2. +28
    -1
      public/js/wn/misc/utils.js
  3. +0
    -1
      public/js/wn/views/grid_report.js

+ 3
- 23
public/js/legacy/widgets/form/form.js Ver ficheiro

@@ -306,31 +306,11 @@ _f.Frm.prototype.setup_footer = function() {
}

_f.Frm.prototype.set_intro = function(txt) {
if(!this.intro_area) {
this.intro_area = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
.insertBefore(this.page_layout.body.firstChild);
}
if(txt) {
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
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 = $('<div class="alert form-intro-area">')
.insertAfter(this.page_layout.body.lastChild);
}
if(txt) {
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
this.footnote_area.html(txt);
} else {
this.footnote_area.remove();
this.footnote_area = null;
}
wn.utils.set_footnote(this, this.page_layout.body, txt);
}


@@ -343,7 +323,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'});
}
}



+ 28
- 1
public/js/wn/misc/utils.js Ver ficheiro

@@ -40,5 +40,32 @@ wn.utils = {
} else {
return list;
}
}
},
set_intro: function(me, wrapper, txt) {
if(!me.intro_area) {
me.intro_area = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
.insertBefore(wrapper.firstChild);
}
if(txt) {
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
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 = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
.insertAfter(wrapper.lastChild);
}
if(txt) {
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
me.footnote_area.html(txt);
} else {
me.footnote_area.remove();
me.footnote_area = null;
}
},
}

+ 0
- 1
public/js/wn/views/grid_report.js Ver ficheiro

@@ -309,7 +309,6 @@ wn.views.GridReport = Class.extend({
</div>').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 = $("<div style='height: 500px; border: 1px solid #aaa; \


Carregando…
Cancelar
Guardar