Explorar el Código

fixed print format builder

version-14
Anand Doshi hace 10 años
padre
commit
343509e001
Se han modificado 2 ficheros con 12 adiciones y 4 borrados
  1. +10
    -4
      frappe/print/page/print_format_builder/print_format_builder.js
  2. +2
    -0
      frappe/public/js/frappe/ui/page.js

+ 10
- 4
frappe/print/page/print_format_builder/print_format_builder.js Ver fichero

@@ -1,5 +1,6 @@
frappe.pages['print-format-builder'].on_page_load = function(wrapper) {
frappe.print_format_builder = new frappe.PrintFormatBuilder(wrapper);
frappe.breadcrumbs.add("Setup", "Print Format");
}

frappe.pages['print-format-builder'].on_page_show = function(wrapper) {
@@ -10,7 +11,7 @@ frappe.pages['print-format-builder'].on_page_show = function(wrapper) {
frappe.route_options = null;
frappe.print_format_builder.setup_new_print_format(doctype, name);
} else {
frappe.print_format_builder.print_format = frappe.route_options;
frappe.print_format_builder.print_format = frappe.route_options.print_format.doc;
frappe.route_options = null;
frappe.print_format_builder.refresh();
}
@@ -206,11 +207,18 @@ frappe.PrintFormatBuilder = Class.extend({
// create a new placeholder for column and set
// it as "column"
var set_column = function() {
if(!section) set_section();
column = me.get_new_column();
section.columns.push(column);
section.no_of_columns += 1;
}

var set_section = function() {
section = me.get_new_section();
column = null;
me.layout_data.push(section);
}

// break the layout into sections and columns
// so that it is easier to render in a template
$.each(this.data, function(i, f) {
@@ -227,9 +235,7 @@ frappe.PrintFormatBuilder = Class.extend({
}

if(f.fieldtype==="Section Break") {
section = me.get_new_section();
column = null;
me.layout_data.push(section);
set_section();

} else if(f.fieldtype==="Column Break") {
set_column();


+ 2
- 0
frappe/public/js/frappe/ui/page.js Ver fichero

@@ -237,6 +237,8 @@ frappe.ui.Page = Class.extend({
},

set_title: function(txt, icon) {
if(!txt) txt = "";

// strip icon
this.title = txt;
frappe.utils.set_title(txt.replace(/<[^>]*>/g, ""));


Cargando…
Cancelar
Guardar