app/assets/javascripts/legislation_annotatable.js
Function initialize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize: function() {
var current_user_id;
$("body").on("renderLegislationAnnotation", App.LegislationAnnotatable.renderAnnotationComments);
$("body").on("click", "[data-annotation-id]", App.LegislationAnnotatable.onClick);
$("body").on("click", "[data-cancel-annotation]", function(e) {
Function onClick
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onClick: function(event) {
var annotation_id, annotation_url, parents, parents_ids, target;
event.preventDefault();
event.stopPropagation();
if (App.LegislationAnnotatable.isMobile()) {
Function customShow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
customShow: function(position) {
var annotation_url;
$(this.element).html("");
// Clean comments section and open it
$("#comments-box").html("");
Function scrollToAnchor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scrollToAnchor: function() {
return {
annotationsLoaded: function() {
var anchor, ann_id, checkExist;
anchor = $(location).attr("hash");