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.

[SD-877] Fix entering taxonomy menu on iOS devices (#10357)

Krzysztof Kalisz7357225e71b4
diff --git a/backend/app/assets/javascripts/spree/backend/taxonomy.js b/backend/app/assets/javascripts/spree/backend/taxonomy.js
index 46268f0a49..4841229ff5 100644
--- a/backend/app/assets/javascripts/spree/backend/taxonomy.js
+++ b/backend/app/assets/javascripts/spree/backend/taxonomy.js
@@ -158,9 +158,16 @@ root.setup_taxonomy_tree = function (taxonomyId) {
return $(this).jstree('core').toggle_node($('.jstree-icon').first())
})
})
+
$taxonomyTree.on('dblclick', 'a', function () {
- $taxonomyTree.jstree('rename', this)
+ var iOS = /iPad|iPhone|iPod/.test(navigator.platform || '')
+ if (iOS) {
+ $taxonomyTree.jstree('show_contextmenu', this)
+ } else {
+ $taxonomyTree.jstree('rename', this)
+ }
})
+
// suppress form submit on enter/return
$(document).keypress(function (event) {
if (event.keyCode === 13) {
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index a17102f4e5..58b7df6d8c 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -1711,7 +1711,7 @@ en:
taxonomy_categories_name: Categories
taxonomy_edit: Edit taxonomy
taxonomy_tree_error: The requested change has not been accepted and the tree has been returned to its previous state, please try again.
- taxonomy_tree_instruction: ! '* Right click a child in the tree to access the menu for adding, deleting or sorting a child.'
+ taxonomy_tree_instruction: ! '* Right click (or double tap on iOS device) a child in the tree to access the menu for adding, deleting or sorting a child.'
taxons: Taxons
test: Test
test_mailer: