mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-25 05:27:33 +08:00
fixing hound
This commit is contained in:
parent
402a77526a
commit
dad0d3868b
5 changed files with 24 additions and 16 deletions
|
|
@ -62,10 +62,10 @@ var Comments = (function() {
|
|||
}
|
||||
|
||||
$(data.html).insertAfter(listItem);
|
||||
if (data.results_number < data.per_page) {
|
||||
if (data.resultsNumber < data.perPage) {
|
||||
moreBtn.remove();
|
||||
} else {
|
||||
moreBtn.attr('href', data.more_url);
|
||||
moreBtn.attr('href', data.moreUrl);
|
||||
moreBtn.trigger('blur');
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,11 @@ var Comments = (function() {
|
|||
}
|
||||
|
||||
function initCommentOptions(scrollableContainer, useParentOffset) {
|
||||
useParentOffset = (typeof useParentOffset !== 'undefined') ? useParentOffset : true;
|
||||
if ( ! _.isUndefined(typeof useParentOffset) ) {
|
||||
useParentOffset = useParentOffset;
|
||||
} else {
|
||||
useParentOffset = true;
|
||||
}
|
||||
scrollCommentOptions($('.dropdown-comment'), useParentOffset);
|
||||
|
||||
// Reposition dropdown to the left
|
||||
|
|
@ -188,7 +192,11 @@ var Comments = (function() {
|
|||
}
|
||||
|
||||
function scrollCommentOptions(selector, useParentOffset) {
|
||||
useParentOffset = (typeof useParentOffset !== 'undefined') ? useParentOffset : true;
|
||||
if ( ! _.isUndefined(typeof useParentOffset) ) {
|
||||
useParentOffset = useParentOffset;
|
||||
} else {
|
||||
useParentOffset = true;
|
||||
}
|
||||
_.each(selector, function(el) {
|
||||
var $el = $(el);
|
||||
var offset = useParentOffset ? $el.offset().top : $el.position().top;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class MyModuleCommentsController < ApplicationController
|
|||
.first.id))
|
||||
end
|
||||
render json: {
|
||||
per_page: @per_page,
|
||||
results_number: @comments.length,
|
||||
more_url: more_url,
|
||||
perPage: @per_page,
|
||||
resultsNumber: @comments.length,
|
||||
moreUrl: more_url,
|
||||
html: render_to_string(
|
||||
partial: partial,
|
||||
locals: {
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ class ProjectCommentsController < ApplicationController
|
|||
.first.id))
|
||||
end
|
||||
render json: {
|
||||
per_page: @per_page,
|
||||
results_number: @comments.length,
|
||||
more_url: more_url,
|
||||
perPage: @per_page,
|
||||
resultsNumber: @comments.length,
|
||||
moreUrl: more_url,
|
||||
html: render_to_string(
|
||||
partial: partial,
|
||||
locals: {
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ class ResultCommentsController < ApplicationController
|
|||
.first.id))
|
||||
end
|
||||
render json: {
|
||||
per_page: @per_page,
|
||||
results_number: @comments.length,
|
||||
more_url: more_url,
|
||||
perPage: @per_page,
|
||||
resultsNumber: @comments.length,
|
||||
moreUrl: more_url,
|
||||
html: render_to_string(partial: partial,
|
||||
locals: { comments: @comments,
|
||||
more_comments_url: more_url })
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class StepCommentsController < ApplicationController
|
|||
from: @comments.first.id))
|
||||
end
|
||||
render json: {
|
||||
per_page: @per_page,
|
||||
results_number: @comments.length,
|
||||
more_url: more_url,
|
||||
perPage: @per_page,
|
||||
resultsNumber: @comments.length,
|
||||
moreUrl: more_url,
|
||||
html: render_to_string(partial: partial,
|
||||
locals: { comments: @comments,
|
||||
more_comments_url: more_url })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue