瀏覽代碼

[fix] sortable now needs group

version-14
Rushabh Mehta 8 年之前
父節點
當前提交
f060cecbf9
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. +9
    -3
      frappe/print/page/print_format_builder/print_format_builder.js

+ 9
- 3
frappe/print/page/print_format_builder/print_format_builder.js 查看文件

@@ -304,7 +304,9 @@ frappe.PrintFormatBuilder = Class.extend({
// drag from fields library
Sortable.create(this.page.sidebar.find(".print-format-builder-fields").get(0),
{
group: {put: true, pull:"clone"},
group: {
name:'field', put: true, pull:"clone"
},
sort: false,
onAdd: function(evt) {
// on drop, trash!
@@ -326,11 +328,13 @@ frappe.PrintFormatBuilder = Class.extend({
var me = this;
Sortable.create(col, {
group: {
name: 'field',
put: true,
pull: true
},
onAdd: function(evt) {
// on drop, change the HTML

var $item = $(evt.item);
if(!$item.hasClass("print-format-builder-field")) {
var fieldname = $item.attr("data-fieldname");
@@ -342,8 +346,10 @@ frappe.PrintFormatBuilder = Class.extend({
fieldname);
}

$item.replaceWith(frappe.render_template("print_format_builder_field",
{field: field, me:me}))
var html = frappe.render_template("print_format_builder_field",
{field: field, me:me});

$item.replaceWith(html);
}
}
});


Loading…
取消
儲存