Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Clean up code

Matthew Kennedy177c24c1ad53
diff --git a/backend/app/assets/javascripts/spree/backend/navigation/menu.es6 b/backend/app/assets/javascripts/spree/backend/navigation/menu.es6
index 6d5a28304f..787d71e0aa 100644
--- a/backend/app/assets/javascripts/spree/backend/navigation/menu.es6
+++ b/backend/app/assets/javascripts/spree/backend/navigation/menu.es6
@@ -15,10 +15,9 @@ document.addEventListener('DOMContentLoaded', function() {
animation: 350,
forceFallback: true,
onEnd: function (evt) {
- const newParentId = evt.to.dataset.parentId
- const position = evt.newIndex
+ handleMenuMove(evt)
}
- };
+ }
let containers = null;
containers = document.querySelectorAll('.menu-container');
@@ -27,3 +26,11 @@ document.addEventListener('DOMContentLoaded', function() {
new Sortable(containers[i], menuItemSortable);
}
})
+
+function handleMenuMove (evt) {
+ const newParentId = evt.to.dataset.parentId
+ const position = evt.newIndex
+
+ console.log(newParentId)
+ console.log(position)
+}
diff --git a/backend/app/helpers/spree/admin/menu_helper.rb b/backend/app/helpers/spree/admin/menu_helper.rb
index 1b833c9f28..03d938144b 100644
--- a/backend/app/helpers/spree/admin/menu_helper.rb
+++ b/backend/app/helpers/spree/admin/menu_helper.rb
@@ -19,7 +19,6 @@ module Spree
end
def menu_item_that_accepts_nested_items(menu, item)
-
decendents = build_menu_item(menu, item.children[0]) unless item.leaf?
info_row = menu_item_bar(menu, item)
@@ -27,11 +26,6 @@ module Spree
content_tag(:div, info_row + sub_menu_container, class: 'menu-item menu-container-item dragable', data: { item_id: item.id })
end
-
-
- def test(a, b)
- b.item.children[0]
- end
end
end
end