Update for new tablednd compatibility

This commit is contained in:
fappels 2017-11-07 16:25:57 +01:00
parent 6ef72a033b
commit 14bc066454
3 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,8 @@ Following changes may create regressions for some external modules, but were nec
* The parameter note into method cloture() is added at end of private note (previously in v6, it replaced)
* The parameter $user is now mandatory for method createFromOrder and createFromPropal.
* Remove js library fileupload that was not used by core code.
* Jquery plugin tableDnd updated. You now need to use decodeURI on the return value of tableDnDSerialize()
and add 'td.' to the beginning of the dragHandle match string.
***** ChangeLog for 6.0.3 compared to 6.0.2 *****

View File

@ -46,8 +46,8 @@ $(document).ready(function(){
onDrop: function(table, row) {
var reloadpage = "<?php echo $forcereloadpage; ?>";
console.log("tableDND onDrop");
console.log($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize());
var roworder = cleanSerialize($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize());
console.log(decodeURI($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()));
var roworder = cleanSerialize(decodeURI($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()));
var table_element_line = "<?php echo $table_element_line; ?>";
var fk_element = "<?php echo $fk_element; ?>";
var element_id = "<?php echo $id; ?>";
@ -75,7 +75,7 @@ $(document).ready(function(){
});
},
onDragClass: "dragClass",
dragHandle: "tdlineupdown"
dragHandle: "td.tdlineupdown"
});
$(".tdlineupdown").hover( function() { $(this).addClass('showDragHandle'); },
function() { $(this).removeClass('showDragHandle'); }

View File

@ -81,7 +81,7 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1;
onDrop: function(table, row) {
console.log('drop');
var reloadpage = "<?php echo $forcereloadpage; ?>";
var roworder = cleanSerialize($("#tablelines").tableDnDSerialize());
var roworder = cleanSerialize(decodeURI($("#tablelines").tableDnDSerialize()));
$.post("<?php echo DOL_URL_ROOT; ?>/variants/ajax/orderAttribute.php",
{
roworder: roworder
@ -100,7 +100,7 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1;
});
},
onDragClass: "dragClass",
dragHandle: "tdlineupdown"
dragHandle: "td.tdlineupdown"
});
});
</script>