diff --git a/app/assets/javascripts/my_modules/protocols.js b/app/assets/javascripts/my_modules/protocols.js index b54a82a97..b294dec22 100644 --- a/app/assets/javascripts/my_modules/protocols.js +++ b/app/assets/javascripts/my_modules/protocols.js @@ -12,7 +12,7 @@ var selectedRow = null; function initEditMyModuleDescription() { var viewObject = $('#my_module_description_view'); viewObject.on('click', function(e) { - if ($(e.target).hasClass('record-info-link') || e.target.tagName === 'A') return; + if ($(e.target).hasClass('record-info-link') || $(e.target).parent().hasClass('record-info-link')) return; TinyMCE.init( '#my_module_description_textarea', { diff --git a/app/assets/javascripts/protocols/header.js b/app/assets/javascripts/protocols/header.js index fd17b98e7..45a0d6dee 100644 --- a/app/assets/javascripts/protocols/header.js +++ b/app/assets/javascripts/protocols/header.js @@ -23,7 +23,7 @@ var ProtocolRepositoryHeader = (function() { function initEditDescription() { var viewObject = $('#protocol_description_view'); viewObject.on('click', function(e) { - if ($(e.target).hasClass('record-info-link')) return; + if ($(e.target).hasClass('record-info-link') || $(e.target).parent().hasClass('record-info-link')) return; TinyMCE.init('#protocol_description_textarea'); }).on('click', 'a', function(e) { if ($(this).hasClass('record-info-link')) return; diff --git a/app/assets/javascripts/sitewide/repository_row_card.js b/app/assets/javascripts/sitewide/repository_row_card.js index 45b049241..556964270 100644 --- a/app/assets/javascripts/sitewide/repository_row_card.js +++ b/app/assets/javascripts/sitewide/repository_row_card.js @@ -4,7 +4,7 @@ 'use strict'; $(document).on('click', '.record-info-link', function(e) { - const myModuleId = $('.my-modules-protocols-index').data('task-id'); + const myModuleId = $('.my-module-content').data('task-id'); const repositoryRowURL = $(this).attr('href'); e.stopPropagation(); diff --git a/app/javascript/vue/shared/tinymce.vue b/app/javascript/vue/shared/tinymce.vue index 613dae50e..466580e4e 100644 --- a/app/javascript/vue/shared/tinymce.vue +++ b/app/javascript/vue/shared/tinymce.vue @@ -122,11 +122,12 @@ initTinymce(e) { let textArea = `#${this.objectType}_textarea_${this.objectId}`; - if (this.active) return - if (e && $(e.target).prop("tagName") === 'A') return - if (e && $(e.target).hasClass('atwho-user-popover')) return - if (e && $(e.target).hasClass('record-info-link')) return - if (e && $(e.target).parent().hasClass('atwho-inserted')) return + if (this.active) return; + if (e && $(e.target).prop("tagName") === 'A') return; + if (e && $(e.target).hasClass('atwho-user-popover')) return; + if (e && $(e.target).hasClass('record-info-link')) return; + if (e && $(e.target).parent().hasClass('record-info-link')) return; + if (e && $(e.target).parent().hasClass('atwho-inserted')) return; TinyMCE.init(textArea, { onSaveCallback: (data) => { diff --git a/app/views/my_modules/protocols.html.erb b/app/views/my_modules/protocols.html.erb index 12f0ca08f..2a4224991 100644 --- a/app/views/my_modules/protocols.html.erb +++ b/app/views/my_modules/protocols.html.erb @@ -26,7 +26,7 @@ <%= render partial: 'shared/drag_n_drop_overlay' %> -