Skip to content

Commit

Permalink
Merge pull request AlchemyCMS#1876 from tvdeyen/page-tree-fix-sorting
Browse files Browse the repository at this point in the history
Fix Page tree sorting after root page removal
  • Loading branch information
tvdeyen authored Jun 10, 2020
2 parents 69fefff + 87b2648 commit e3f94b4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions app/assets/javascripts/alchemy/alchemy.page_sorter.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Alchemy.PageSorter = function() {
var $sortables = $('ul#sitemap').find('ul.level_1_children');
Alchemy.PageSorter = function () {
var $sortables = $("ul#sitemap").find("ul.level_0_children")

$sortables.nestedSortable({
disableNesting: 'no-nest',
disableNesting: "no-nest",
forcePlaceholderSize: true,
handle: '.handle',
items: 'li',
listType: 'ul',
handle: ".handle",
items: "li",
listType: "ul",
opacity: 0.5,
placeholder: 'placeholder',
placeholder: "placeholder",
tabSize: 16,
tolerance: 'pointer',
toleranceElement: '> div'
});
tolerance: "pointer",
toleranceElement: "> div"
})

$('#save_page_order').click(function(e) {
e.preventDefault();
Alchemy.Buttons.disable(this);
$("#save_page_order").click(function (e) {
e.preventDefault()
Alchemy.Buttons.disable(this)
$.post(Alchemy.routes.order_admin_pages_path, {
set: JSON.stringify($sortables.nestedSortable('toHierarchy'))
});
});
};
set: JSON.stringify($sortables.nestedSortable("toHierarchy"))
})
})
}

0 comments on commit e3f94b4

Please sign in to comment.