From f48d332a76784010780af3da8110b5eaeda22bda Mon Sep 17 00:00:00 2001 From: arturu Date: Thu, 16 Nov 2017 00:50:50 +0100 Subject: [PATCH 1/2] Serialize get data-* from DOM, bypass data-* cache --- jquery.nestable.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jquery.nestable.js b/jquery.nestable.js index a6e0c42..e21a080 100644 --- a/jquery.nestable.js +++ b/jquery.nestable.js @@ -448,8 +448,17 @@ var array = [], items = level.children(list.options.itemNodeName); items.each(function() { + // Get data-* from DOM, bypass data-* cache + var liData = {}; + $(this).each(function() { + $.each(this.attributes, function() { + if(this.specified && this.name.startsWith("data-")) { + liData[this.name.replace("data-", "")] = this.value; + } + }); + }); var li = $(this), - item = $.extend({}, li.data()), + item = $.extend({}, liData), sub = li.children(list.options.listNodeName); if (list.options.includeContent) { From efb63d09f959e225939aa5d92c67bc8a301866d5 Mon Sep 17 00:00:00 2001 From: arturu Date: Thu, 16 Nov 2017 01:52:37 +0100 Subject: [PATCH 2/2] Serialize get data-* from DOM, bypass data-* cache --- jquery.nestable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.nestable.js b/jquery.nestable.js index e21a080..80f9111 100644 --- a/jquery.nestable.js +++ b/jquery.nestable.js @@ -452,7 +452,7 @@ var liData = {}; $(this).each(function() { $.each(this.attributes, function() { - if(this.specified && this.name.startsWith("data-")) { + if (this.specified && this.name.startsWith("data-")) { liData[this.name.replace("data-", "")] = this.value; } });