From 6402bee23fee8cc908e2c48e0d5a194cce706d1c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 15 Jan 2014 11:11:28 +0530 Subject: [PATCH 1/5] Minor fix in text editor --- public/js/wn/ui/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/wn/ui/editor.js b/public/js/wn/ui/editor.js index 2448b69d2c..c1d6d705b5 100644 --- a/public/js/wn/ui/editor.js +++ b/public/js/wn/ui/editor.js @@ -123,8 +123,10 @@ bsEditor = Class.extend({ }, clean_html: function() { + var html = this.editor.html() || ""; - html = html.replace(/(
|\s|

<\/div>| )*$/, ''); + if(!strip(this.editor.text())) html = ""; + // html = html.replace(/(
|\s|

<\/div>| )*$/, ''); // remove custom typography (use CSS!) if(this.options.remove_typography) { From 335deed6e80f1a98edaaebea660b921c8588c66c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Jan 2014 12:06:10 +0530 Subject: [PATCH 2/5] Show listview columns order by idx --- public/js/wn/views/listview.js | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/public/js/wn/views/listview.js b/public/js/wn/views/listview.js index cf89dfde0a..fc2b70573f 100644 --- a/public/js/wn/views/listview.js +++ b/public/js/wn/views/listview.js @@ -87,25 +87,26 @@ wn.views.ListView = Class.extend({ var overridden = $.map(this.settings.add_columns || [], function(d) { return d.content; }); + var docfields_in_list_view = wn.model.get("DocField", {"parent":this.doctype, + "in_list_view":1}).sort(function(a, b) { return a.idx - b.idx }) - $.each(wn.model.get("DocField", {"parent":this.doctype, "in_list_view":1}), - function(i,d) { - if(in_list(overridden, d.fieldname)) { - return; - } - // field width - var colspan = "3"; - if(in_list(["Int", "Percent", "Select"], d.fieldtype)) { - colspan = "2"; - } else if(d.fieldtype=="Check") { - colspan = "1"; - } else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer - colspan = "4"; - } else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") { - colspan = "4"; - } - me.columns.push({colspan: colspan, content: d.fieldname, - type:d.fieldtype, df:d, title:wn._(d.label) }); + $.each(docfields_in_list_view, function(i,d) { + if(in_list(overridden, d.fieldname)) { + return; + } + // field width + var colspan = "3"; + if(in_list(["Int", "Percent", "Select"], d.fieldtype)) { + colspan = "2"; + } else if(d.fieldtype=="Check") { + colspan = "1"; + } else if(in_list(["name", "subject", "title"], d.fieldname)) { // subjects are longer + colspan = "4"; + } else if(d.fieldtype=="Text Editor" || d.fieldtype=="Text") { + colspan = "4"; + } + me.columns.push({colspan: colspan, content: d.fieldname, + type:d.fieldtype, df:d, title:wn._(d.label) }); }); // additional columns From 08ffa4edc07292e19ac261d8fa9c58d52d1595a2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Jan 2014 12:07:08 +0530 Subject: [PATCH 3/5] Always reset filters through set_route --- public/js/wn/views/reportview.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/wn/views/reportview.js b/public/js/wn/views/reportview.js index 5dbde7c412..d4b8c627e5 100644 --- a/public/js/wn/views/reportview.js +++ b/public/js/wn/views/reportview.js @@ -38,10 +38,16 @@ wn.views.ReportViewPage = Class.extend({ }); }, make_page: function() { + var me = this; this.page = wn.container.add_page(this.page_name); wn.ui.make_app_page({parent:this.page, single_column:true}); wn.container.change_to(this.page_name); + + $(this.page).on('show', function(){ + if(me.page.reportview.set_route_filters()) + me.page.reportview.run(); + }) }, make_report_view: function() { var module = locals.DocType[this.doctype].module; @@ -147,10 +153,12 @@ wn.views.ReportView = wn.ui.Listing.extend({ set_route_filters: function() { var me = this; if(wn.route_options) { + me.filter_list.clear_filters(); $.each(wn.route_options, function(key, value) { me.filter_list.add_filter(me.doctype, key, "=", value); }); wn.route_options = null; + return true; } }, From 10705d0d950d8449cca774a18a71ccfc1536386f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Jan 2014 14:57:10 +0530 Subject: [PATCH 4/5] Print Table: sort cloumns by idx after removing empty cols --- public/js/wn/print/print_table.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/wn/print/print_table.js b/public/js/wn/print/print_table.js index 6f3f3160c5..8fb33ccf4b 100644 --- a/public/js/wn/print/print_table.js +++ b/public/js/wn/print/print_table.js @@ -53,13 +53,13 @@ wn.print.Table = Class.extend({ } }); }); - + var columns = [], widths = [], head_labels = []; // make new arrays to remove empty cols, widths and head labels - $.each(cols_with_value, function(i, col_idx) { + $.each(cols_with_value.sort(), function(i, col_idx) { columns.push(me.columns[col_idx]); me.widths && widths.push(me.widths[col_idx]); me.head_labels && head_labels.push(me.head_labels[col_idx]); From 5a2e6aab87bf6175f5672674b51eeda3fb435bd4 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 16 Jan 2014 16:59:18 +0600 Subject: [PATCH 5/5] bumped to version 3.7.2 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 4c93bafc7f..0099957b97 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.7.1", + "framework_version": "3.7.2", "modules": { "Calendar": { "color": "#2980b9",