mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 21:36:44 +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;
|
return true;
|
||||||
},
|
},
|
||||||
tplEval: function(_tpl, items) {
|
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) {
|
highlighter: function(li, query) {
|
||||||
return matchHighlighter(li, query);
|
return matchHighlighter(li, query);
|
||||||
|
@ -123,7 +125,7 @@ var SmartAnnotation = (function() {
|
||||||
$(field)
|
$(field)
|
||||||
.on('shown.atwho', function() {
|
.on('shown.atwho', function() {
|
||||||
var $currentAtWho = $('.atwho-view[style]:not(.old)');
|
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);
|
$currentAtWho.addClass('old').attr('data-at-who-id', atWhoId);
|
||||||
$(field).attr('data-smart-annotation', atWhoId);
|
$(field).attr('data-smart-annotation', atWhoId);
|
||||||
|
|
||||||
|
@ -140,7 +142,7 @@ var SmartAnnotation = (function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($currentAtWho.find('.tab-pane.active').length === 0) {
|
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 teamId = $currentAtWho.find('.atwho-header-res').data('team-id');
|
||||||
let remeberedState = localStorage.getItem('smart_annotation_states/teams/' + teamId);
|
let remeberedState = localStorage.getItem('smart_annotation_states/teams/' + teamId);
|
||||||
if (remeberedState) {
|
if (remeberedState) {
|
||||||
|
@ -179,8 +181,10 @@ var SmartAnnotation = (function() {
|
||||||
callback(data.users);
|
callback(data.users);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
tplEval: function(_tpl, map) {
|
tplEval: function(_tpl, items) {
|
||||||
return map.name;
|
var $items = $(items.name);
|
||||||
|
$items.find('li').data('item-data', []); // Emulate at.js insertContentFor method
|
||||||
|
return $items;
|
||||||
},
|
},
|
||||||
highlighter: function(li, query) {
|
highlighter: function(li, query) {
|
||||||
return matchHighlighter(li, query);
|
return matchHighlighter(li, query);
|
||||||
|
|
Loading…
Add table
Reference in a new issue