Skip to content

Commit

Permalink
Fix saving sitemap definitions (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin authored Oct 9, 2024
1 parent a427498 commit fd6c2e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 3 additions & 2 deletions assets/js/sitemap-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}(window.jQuery);
8 changes: 0 additions & 8 deletions formwidgets/SitemapItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 1 addition & 0 deletions formwidgets/sitemapitems/partials/_sitemapitems.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
data-control="sitemap-item-editor"
data-alias="<?= $this->alias ?>"
data-item-properties="<?= e($itemProperties) ?>"
data-field-name="<?= $this->getFieldName() ?>"
>
<div class="control-scrollbar" data-control="scrollbar">
<div class="control-treeview treeview-light"
Expand Down

0 comments on commit fd6c2e3

Please sign in to comment.