diff --git a/assets/js/sitemap-definitions.js b/assets/js/sitemap-definitions.js index f69e10c..82b745c 100644 --- a/assets/js/sitemap-definitions.js +++ b/assets/js/sitemap-definitions.js @@ -49,11 +49,12 @@ return result } - data.options.data['itemData'] = iterator($items) + const fieldName = $('div[data-control=sitemap-item-editor]').data('fieldName') + data.options.data[fieldName] = iterator($items); } $(document).ready(function(){ $.wn.sitemapDefinitions = new SitemapDefinitions() }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/formwidgets/SitemapItems.php b/formwidgets/SitemapItems.php index 55595d8..063cedf 100644 --- a/formwidgets/SitemapItems.php +++ b/formwidgets/SitemapItems.php @@ -75,14 +75,6 @@ protected function loadAssets() $this->addJs('js/sitemap-items-editor.js', 'core'); } - /** - * {@inheritDoc} - */ - public function getSaveValue($value) - { - return post('itemData'); - } - // // Methods for the internal use // diff --git a/formwidgets/sitemapitems/partials/_sitemapitems.htm b/formwidgets/sitemapitems/partials/_sitemapitems.htm index 8d6acd4..658bff8 100644 --- a/formwidgets/sitemapitems/partials/_sitemapitems.htm +++ b/formwidgets/sitemapitems/partials/_sitemapitems.htm @@ -3,6 +3,7 @@ data-control="sitemap-item-editor" data-alias="alias ?>" data-item-properties="" + data-field-name="getFieldName() ?>" >