Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion backend/app/assets/javascripts/spree/backend/taxonomy.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion core/config/locales/en.yml
Expand Up @@ -1706,7 +1706,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:
Expand Down