From 0b2ba88f71f5c7f520ade158659d797b7c62eab8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 24 May 2019 20:54:06 +0200 Subject: [PATCH] Text fields focus issue (#46) --- README.md | 1 + assets/javascripts/issue_dynamic_edit.js | 5 ++++- init.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3857ca7..68d95fc 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ This plugin uses [FontAwesome icons](http://fontawesome.io/) ### 🆕 Changelog +* **v 0.6.7** : fixed Github issue #46 : text field focus issue * **v 0.6.6** : New configuration file + Multiple fixes (#30 #31 #35 #36 #37 #38 #41) * **v 0.6.5** : Checklists plugin support (and all other plugins that compute fields when there's an issue update) (Github requests #26 and #28) + custom url support (Github request #29) * **v 0.6.4** : version field with checkbox display is now supported, Target version and Assignee fields are also supported (Github request #24) diff --git a/assets/javascripts/issue_dynamic_edit.js b/assets/javascripts/issue_dynamic_edit.js index 35d0923..57a1576 100644 --- a/assets/javascripts/issue_dynamic_edit.js +++ b/assets/javascripts/issue_dynamic_edit.js @@ -33,7 +33,10 @@ $(document).on(_CONF_LISTENER_TYPE, function(e){ if($(e.target).closest('.' + _CONF_LISTENER_TARGET).length) { // avoid text selection if dblclick var sel = window.getSelection ? window.getSelection() : document.selection; - if (sel) { + var activeElement = document.activeElement; + var inputs = ['input', 'select', 'button', 'textarea']; + + if (sel && inputs.indexOf(activeElement.tagName.toLowerCase()) === -1) { if (sel.removeAllRanges) { sel.removeAllRanges(); } else if (sel.empty) { diff --git a/init.rb b/init.rb index 1eb95bb..65af94e 100644 --- a/init.rb +++ b/init.rb @@ -6,7 +6,7 @@ Redmine::Plugin.register :redmine_issue_dynamic_edit do name 'Redmine Dynamic edit Issue plugin' author 'Hugo Zilliox' description 'Allows users to dynamically update issue attributes in detailed view without refreshing the page (JIRA style)' - version '0.6.6' + version '0.6.7' url 'https://github.com/ilogeek/redmine_issue_dynamic_edit' author_url 'https://hzilliox.fr' end