mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-02 09:54:37 +08:00
Merge pull request #2859 from aignatov-bio/ai-sci-5036-fix-smart-annotation-cursor-position
Fix smart annotation cursor position [SCI-5036]
This commit is contained in:
commit
7fa98de1da
1 changed files with 9 additions and 5 deletions
|
@ -85,7 +85,9 @@ var SmartAnnotation = (function() {
|
|||
return true;
|
||||
},
|
||||
tplEval: function(_tpl, items) {
|
||||
return items.name;
|
||||
var $items = $(items.name);
|
||||
$items.find('li').data('item-data', []); // Emulate at.js insertContentFor method
|
||||
return $items;
|
||||
},
|
||||
highlighter: function(li, query) {
|
||||
return matchHighlighter(li, query);
|
||||
|
@ -123,7 +125,7 @@ var SmartAnnotation = (function() {
|
|||
$(field)
|
||||
.on('shown.atwho', function() {
|
||||
var $currentAtWho = $('.atwho-view[style]:not(.old)');
|
||||
var atWhoId = $currentAtWho.find('.atwho-header-res').data('at-who-key')
|
||||
var atWhoId = $currentAtWho.find('.atwho-header-res').data('at-who-key');
|
||||
$currentAtWho.addClass('old').attr('data-at-who-id', atWhoId);
|
||||
$(field).attr('data-smart-annotation', atWhoId);
|
||||
|
||||
|
@ -140,7 +142,7 @@ var SmartAnnotation = (function() {
|
|||
});
|
||||
|
||||
if ($currentAtWho.find('.tab-pane.active').length === 0) {
|
||||
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
||||
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
||||
let teamId = $currentAtWho.find('.atwho-header-res').data('team-id');
|
||||
let remeberedState = localStorage.getItem('smart_annotation_states/teams/' + teamId);
|
||||
if (remeberedState) {
|
||||
|
@ -179,8 +181,10 @@ var SmartAnnotation = (function() {
|
|||
callback(data.users);
|
||||
});
|
||||
},
|
||||
tplEval: function(_tpl, map) {
|
||||
return map.name;
|
||||
tplEval: function(_tpl, items) {
|
||||
var $items = $(items.name);
|
||||
$items.find('li').data('item-data', []); // Emulate at.js insertContentFor method
|
||||
return $items;
|
||||
},
|
||||
highlighter: function(li, query) {
|
||||
return matchHighlighter(li, query);
|
||||
|
|
Loading…
Add table
Reference in a new issue