Sfoglia il codice sorgente

[fix] sortable now needs group

version-14
Rushabh Mehta 8 anni fa
parent
commit
f060cecbf9
1 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  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 Vedi File

@@ -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);
}
}
});


Caricamento…
Annulla
Salva