mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-07 16:09:57 +08:00
Merge pull request #1387 from okriuchykhin/ok_SCI_2877
Fix comments form for new results [SCI-2877]
This commit is contained in:
commit
f811afc7e2
3 changed files with 2 additions and 33 deletions
|
@ -22,7 +22,6 @@ var Comments = (function() {
|
|||
beforeSend: animateSpinner(that, true) })
|
||||
.done(function(data) {
|
||||
that.html(data.html);
|
||||
|
||||
})
|
||||
.always(function() {
|
||||
animateSpinner(that, false);
|
||||
|
@ -51,7 +50,7 @@ var Comments = (function() {
|
|||
// Initialize show more comments link.
|
||||
function initCommentsLink($el) {
|
||||
|
||||
$el.find('.btn-more-comments')
|
||||
$el.find('.btn-more-comments').off()
|
||||
.on('ajax:success', function (e, data) {
|
||||
if (data.html) {
|
||||
var list = $(this).parents('ul');
|
||||
|
@ -92,7 +91,7 @@ var Comments = (function() {
|
|||
|
||||
$('.help-block', $form).addClass('hide');
|
||||
|
||||
$form.on('ajax:send', function () {
|
||||
$form.off().on('ajax:send', function () {
|
||||
$('#comment_message', $form).attr('readonly', true);
|
||||
})
|
||||
.on('ajax:success', function (e, data) {
|
||||
|
@ -164,33 +163,6 @@ var Comments = (function() {
|
|||
});
|
||||
}
|
||||
|
||||
// restore comments after update or when new element is created
|
||||
function bindCommentInitializerToNewElement() {
|
||||
if( document.getElementById('steps') !== null ) {
|
||||
$('#steps')
|
||||
.change(function() {
|
||||
$('.step-save')
|
||||
.on('click', function() {
|
||||
$(document)
|
||||
.on('ajax:success', function(){
|
||||
initializeComments();
|
||||
});
|
||||
});
|
||||
});
|
||||
} else if ( document.getElementById('results') !== null ) {
|
||||
$('#results')
|
||||
.change(function() {
|
||||
$('.save-result')
|
||||
.on('click', function() {
|
||||
$(document)
|
||||
.on('ajax:success', function(){
|
||||
initializeComments();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initCommentOptions(scrollableContainer, useParentOffset) {
|
||||
if ( ! _.isUndefined(useParentOffset) ) {
|
||||
useParentOffset = useParentOffset;
|
||||
|
@ -377,7 +349,6 @@ var Comments = (function() {
|
|||
scrollBottom: scrollBottom,
|
||||
moreComments: initCommentsLink,
|
||||
form: initCommentForm,
|
||||
bindNewElement: bindCommentInitializerToNewElement,
|
||||
initCommentOptions: initCommentOptions,
|
||||
initDeleteComments: initDeleteComments,
|
||||
initEditComments: initEditComments
|
||||
|
|
|
@ -16,7 +16,6 @@ function init() {
|
|||
initLoadFromRepository();
|
||||
initRefreshStatusBar();
|
||||
initImport();
|
||||
Comments.bindNewElement();
|
||||
setupAssetsLoading();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
_expandAllResults();
|
||||
applyCollapseLinkCallBack();
|
||||
|
||||
Comments.bindNewElement();
|
||||
Comments.initialize();
|
||||
|
||||
Comments.initCommentOptions('ul.content-comments');
|
||||
|
|
Loading…
Reference in a new issue