Преглед изворни кода

Merge pull request #420 from akhileshdarjee/hotfix

Alphabetically listing of print formats
version-14
Nabin Hait пре 11 година
родитељ
комит
adfbabc810
2 измењених фајлова са 9 додато и 8 уклоњено
  1. +8
    -7
      public/js/wn/model/meta.js
  2. +1
    -1
      public/js/wn/ui/editor.js

+ 8
- 7
public/js/wn/model/meta.js Прегледај датотеку

@@ -93,13 +93,8 @@ $.extend(wn.meta, {
},
get_print_formats: function(doctype) {
// if default print format is given, use it
var print_format_list = [];
if(locals.DocType[doctype].default_print_format)
print_format_list.push(locals.DocType[doctype].default_print_format)
if(!in_list(print_format_list, "Standard"))
print_format_list.push("Standard");
var print_format_list = ["Standard"];
var default_print_format = locals.DocType[doctype].default_print_format;
var print_formats = wn.model.get("Print Format", {doc_type: doctype})
.sort(function(a, b) { return (a > b) ? 1 : -1; });
@@ -107,6 +102,12 @@ $.extend(wn.meta, {
if(!in_list(print_format_list, d.name))
print_format_list.push(d.name);
});

if(default_print_format && default_print_format != "Standard") {
var index = print_format_list.indexOf(default_print_format) - 1;
print_format_list.sort().splice(index, 1);
print_format_list.unshift(default_print_format);
}
return print_format_list;
},


+ 1
- 1
public/js/wn/ui/editor.js Прегледај датотеку

@@ -125,7 +125,7 @@ bsEditor = Class.extend({
clean_html: function() {
var html = this.editor.html() || "";
if(!strip(this.editor.text())) html = "";
if(!strip(this.editor.text()) && !(this.editor.find("img"))) html = "";
// html = html.replace(/(<br>|\s|<div><br><\/div>|&nbsp;)*$/, '');

// remove custom typography (use CSS!)


Loading…
Откажи
Сачувај