mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 14:44:26 +08:00
fixes issue with smart annotations in repositories [fixes SCI-1452]
This commit is contained in:
parent
53a1dd14b7
commit
baaec67399
2 changed files with 10 additions and 2 deletions
|
@ -573,7 +573,6 @@ function onClickEdit() {
|
|||
});
|
||||
|
||||
// initialize smart annotation
|
||||
SmartAnnotation.init($('[data-object="repository_cell"]'));
|
||||
_.each($('[data-object="repository_cell"]'), function(el) {
|
||||
if (_.isUndefined($(el).data('atwho'))) {
|
||||
SmartAnnotation.init(el);
|
||||
|
@ -642,9 +641,11 @@ function onClickSave() {
|
|||
data: data,
|
||||
success: function(data) {
|
||||
HelperModule.flashAlertMsg(data.flash, 'success');
|
||||
SmartAnnotation.closePopup();
|
||||
onClickCancel();
|
||||
},
|
||||
error: function(e) {
|
||||
SmartAnnotation.closePopup();
|
||||
var data = e.responseJSON;
|
||||
clearAllErrors();
|
||||
|
||||
|
@ -794,6 +795,7 @@ function onClickCancel() {
|
|||
}, false);
|
||||
changeToViewMode();
|
||||
updateButtons();
|
||||
SmartAnnotation.closePopup();
|
||||
animateSpinner(null, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -424,6 +424,11 @@ var SmartAnnotation = (function() {
|
|||
init: init
|
||||
};
|
||||
}
|
||||
// Closes the atwho popup * needed in repositories to close the popup
|
||||
// if nothing is selected and the user leaves the form *
|
||||
function closePopup() {
|
||||
$('.atwho-header-res').find('.glyphicon-remove').click();
|
||||
}
|
||||
|
||||
function initialize(field) {
|
||||
var atWho = new setAtWho(field);
|
||||
|
@ -432,7 +437,8 @@ var SmartAnnotation = (function() {
|
|||
|
||||
var publicApi = Object.freeze({
|
||||
init: initialize,
|
||||
preventPropagation: atwhoStopPropagation
|
||||
preventPropagation: atwhoStopPropagation,
|
||||
closePopup: closePopup
|
||||
});
|
||||
|
||||
return publicApi;
|
||||
|
|
Loading…
Reference in a new issue