mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-30 17:04:31 +08:00
Fix smart annotation cursor position
This commit is contained in:
parent
9fda2dd97e
commit
fd7773a3dc
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