mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-30 07:58:28 +08:00
Merge pull request #2869 from aignatov-bio/ai-sci-5038-fix-smart-annotaion-link-for-inventory-items
Improve smart annotation in TinyMCE fields [SCI-5038]
This commit is contained in:
commit
d02d48f10f
2 changed files with 8 additions and 4 deletions
|
|
@ -11,9 +11,11 @@ var selectedRow = null;
|
||||||
|
|
||||||
function initEditMyModuleDescription() {
|
function initEditMyModuleDescription() {
|
||||||
var viewObject = $('#my_module_description_view');
|
var viewObject = $('#my_module_description_view');
|
||||||
viewObject.on('click', function() {
|
viewObject.on('click', function(e) {
|
||||||
|
if ($(e.target).hasClass('record-info-link')) return;
|
||||||
TinyMCE.init('#my_module_description_textarea');
|
TinyMCE.init('#my_module_description_textarea');
|
||||||
}).on('click', 'a', function(e) {
|
}).on('click', 'a', function(e) {
|
||||||
|
if ($(this).hasClass('record-info-link')) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
TinyMCE.initIfHasDraft(viewObject);
|
TinyMCE.initIfHasDraft(viewObject);
|
||||||
|
|
@ -21,9 +23,11 @@ function initEditMyModuleDescription() {
|
||||||
|
|
||||||
function initEditProtocolDescription() {
|
function initEditProtocolDescription() {
|
||||||
var viewObject = $('#protocol_description_view');
|
var viewObject = $('#protocol_description_view');
|
||||||
viewObject.on('click', function() {
|
viewObject.on('click', function(e) {
|
||||||
|
if ($(e.target).hasClass('record-info-link')) return;
|
||||||
TinyMCE.init('#protocol_description_textarea', refreshProtocolStatusBar);
|
TinyMCE.init('#protocol_description_textarea', refreshProtocolStatusBar);
|
||||||
}).on('click', 'a', function(e) {
|
}).on('click', 'a', function(e) {
|
||||||
|
if ($(this).hasClass('record-info-link')) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
TinyMCE.initIfHasDraft(viewObject);
|
TinyMCE.initIfHasDraft(viewObject);
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ var SmartAnnotation = (function() {
|
||||||
},
|
},
|
||||||
tplEval: function(_tpl, items) {
|
tplEval: function(_tpl, items) {
|
||||||
var $items = $(items.name);
|
var $items = $(items.name);
|
||||||
$items.find('li').data('item-data', []); // Emulate at.js insertContentFor method
|
$items.find('li').data('item-data', { 'atwho-at': at }); // Emulate at.js insertContentFor method
|
||||||
return $items;
|
return $items;
|
||||||
},
|
},
|
||||||
highlighter: function(li, query) {
|
highlighter: function(li, query) {
|
||||||
|
|
@ -183,7 +183,7 @@ var SmartAnnotation = (function() {
|
||||||
},
|
},
|
||||||
tplEval: function(_tpl, items) {
|
tplEval: function(_tpl, items) {
|
||||||
var $items = $(items.name);
|
var $items = $(items.name);
|
||||||
$items.find('li').data('item-data', []); // Emulate at.js insertContentFor method
|
$items.find('li').data('item-data', { 'atwho-at': '@' }); // Emulate at.js insertContentFor method
|
||||||
return $items;
|
return $items;
|
||||||
},
|
},
|
||||||
highlighter: function(li, query) {
|
highlighter: function(li, query) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue