Remove unused variables
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
App.ColumnsSelector =
|
||||
|
||||
initColums: (name) ->
|
||||
initColums: () ->
|
||||
App.ColumnsSelector.hideAll()
|
||||
c_value = App.ColumnsSelector.currentValue()
|
||||
|
||||
@@ -15,8 +15,6 @@ App.ColumnsSelector =
|
||||
$("#column_selector_" + column).prop("checked", true)
|
||||
|
||||
initChecks: () ->
|
||||
fields = $(".column-selecteable th[data-field]")
|
||||
columns = []
|
||||
$(".column-selecteable th[data-field]").each ->
|
||||
field = $(this).data("field")
|
||||
text = $.trim($(this).text())
|
||||
@@ -70,7 +68,7 @@ App.ColumnsSelector =
|
||||
|
||||
initialize: ->
|
||||
App.ColumnsSelector.initChecks()
|
||||
columns = App.ColumnsSelector.initColums($("#js-columns-selector").data("cookie"))
|
||||
App.ColumnsSelector.initColums()
|
||||
|
||||
$("#js-columns-selector").on
|
||||
click: (event) ->
|
||||
|
||||
@@ -10,7 +10,7 @@ App.Comments =
|
||||
$("##{parent_id} .comment-children:first").prepend($(response_html))
|
||||
this.update_comments_count()
|
||||
|
||||
update_comments_count: (parent_id) ->
|
||||
update_comments_count: ->
|
||||
$(".js-comments-count").each ->
|
||||
new_val = $(this).text().trim().replace /\d+/, (match) -> parseInt(match, 10) + 1
|
||||
$(this).text(new_val)
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
};
|
||||
|
||||
ProposalGraph.prototype.formatXColumnValues = function () {
|
||||
var i, l, parts;
|
||||
var i, l;
|
||||
|
||||
this.xColumnValues = this.xColumnValues.sort();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ App.Documentable =
|
||||
$.each inputFiles, (index, input) ->
|
||||
App.Documentable.initializeDirectUploadInput(input)
|
||||
|
||||
$("#nested-documents").on "cocoon:after-remove", (e, insertedItem) ->
|
||||
$("#nested-documents").on "cocoon:after-remove", ->
|
||||
App.Documentable.unlockUploads()
|
||||
|
||||
$("#nested-documents").on "cocoon:after-insert", (e, nested_document) ->
|
||||
|
||||
@@ -19,7 +19,7 @@ i18n = {
|
||||
}
|
||||
}
|
||||
|
||||
window.Gettext = (key) ->
|
||||
window.Gettext = ->
|
||||
gettext: (key) ->
|
||||
locale_id = $("html").attr("lang")
|
||||
locale = i18n[locale_id]
|
||||
|
||||
@@ -5,10 +5,10 @@ App.Imageable =
|
||||
$.each inputFiles, (index, input) ->
|
||||
App.Imageable.initializeDirectUploadInput(input)
|
||||
|
||||
$("#nested-image").on "cocoon:after-remove", (e, item) ->
|
||||
$("#nested-image").on "cocoon:after-remove", ->
|
||||
$("#new_image_link").removeClass("hide")
|
||||
|
||||
$("#nested-image").on "cocoon:before-insert", (e, nested_image) ->
|
||||
$("#nested-image").on "cocoon:before-insert", ->
|
||||
if $(".js-image-attachment").length > 0
|
||||
$(".js-image-attachment").closest(".image").remove()
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ App.LegislationAllegations =
|
||||
App.LegislationAllegations.toggle_comments()
|
||||
|
||||
$(".js-toggle-allegations").on
|
||||
click: (e) ->
|
||||
click: ->
|
||||
# Toggle comments when the section title is visible
|
||||
if !App.LegislationAnnotatable.isMobile()
|
||||
if $(this).find(".draft-panel .panel-title:visible").length == 0
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
_t = (key) -> new Gettext().gettext(key)
|
||||
|
||||
App.LegislationAnnotatable =
|
||||
|
||||
makeEditableAndHighlight: (colour) ->
|
||||
@@ -83,7 +81,7 @@ App.LegislationAnnotatable =
|
||||
return window.innerWidth <= 652
|
||||
|
||||
viewerExtension: (viewer) ->
|
||||
viewer._onHighlightMouseover = (event) ->
|
||||
viewer._onHighlightMouseover = ->
|
||||
return
|
||||
|
||||
customShow: (position) ->
|
||||
@@ -106,7 +104,7 @@ App.LegislationAnnotatable =
|
||||
App.LegislationAnnotatable.highlight("#7fff9a")
|
||||
$("#comments-box textarea").focus()
|
||||
|
||||
$("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) ->
|
||||
$("#new_legislation_annotation").on("ajax:complete", (e, data) ->
|
||||
App.LegislationAnnotatable.app.destroy()
|
||||
if data.status == 200
|
||||
App.LegislationAnnotatable.remove_highlight()
|
||||
@@ -127,7 +125,7 @@ App.LegislationAnnotatable =
|
||||
editor.show = App.LegislationAnnotatable.customShow
|
||||
|
||||
scrollToAnchor: ->
|
||||
annotationsLoaded: (annotations) ->
|
||||
annotationsLoaded: ->
|
||||
anchor = $(location).attr("hash")
|
||||
if anchor && anchor.startsWith("#annotation")
|
||||
ann_id = anchor.split("-")[-1..]
|
||||
@@ -183,7 +181,6 @@ App.LegislationAnnotatable =
|
||||
|
||||
$(".legislation-annotatable").each ->
|
||||
$this = $(this)
|
||||
ann_type = "legislation_draft_version"
|
||||
ann_id = $this.data("legislation-draft-version-id")
|
||||
base_url = $this.data("legislation-annotatable-base-url")
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ App.Managers =
|
||||
$("#user_password").prop "type", type
|
||||
|
||||
initialize: ->
|
||||
$(".generate-random-value").on "click", (event) ->
|
||||
$(".generate-random-value").on "click", ->
|
||||
password = App.Managers.generatePassword()
|
||||
$("#user_password").val(password)
|
||||
|
||||
$(".show-password").on "click", (event) ->
|
||||
$(".show-password").on "click", ->
|
||||
if $("#user_password").is("input[type='password']")
|
||||
App.Managers.togglePassword("text")
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
App.Sortable =
|
||||
initialize: ->
|
||||
$(".sortable").sortable
|
||||
update: (event, ui) ->
|
||||
update: ->
|
||||
new_order = $(this).sortable("toArray", { attribute: "data-answer-id" })
|
||||
$.ajax
|
||||
url: $(".sortable").data("js-url"),
|
||||
@@ -9,7 +9,7 @@ App.Sortable =
|
||||
type: "POST"
|
||||
|
||||
$(".sortable-priotirized-votation").sortable
|
||||
update: (event, ui) ->
|
||||
update: ->
|
||||
new_order = $(this).sortable("toArray", { attribute: "data-answer-id" })
|
||||
$.ajax
|
||||
url: $(this).data("js-url"),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
buildGraph = (el) ->
|
||||
url = $(el).data "graph"
|
||||
conf = bindto: el, data: { x: "x", url: url, mimeType: "json" }, axis: { x: { type: "timeseries", tick: { format: "%Y-%m-%d" } } }
|
||||
graph = c3.generate conf
|
||||
c3.generate conf
|
||||
|
||||
App.Stats =
|
||||
initialize: ->
|
||||
|
||||
@@ -20,7 +20,7 @@ App.TreeNavigator =
|
||||
App.TreeNavigator.setNodes(ul.children())
|
||||
|
||||
$("[data-tree-navigator] span").on
|
||||
click: (e) ->
|
||||
click: ->
|
||||
elem = $(this)
|
||||
if(elem.hasClass("open"))
|
||||
elem.removeClass("open").addClass("closed")
|
||||
|
||||
@@ -6,7 +6,7 @@ App.WatchFormChanges =
|
||||
if($("[data-watch-form-message]").length)
|
||||
return $("[data-watch-form-message]").data("watch-form-message")
|
||||
|
||||
checkChanges: (event) ->
|
||||
checkChanges: ->
|
||||
changes = false
|
||||
App.WatchFormChanges.forms().each ->
|
||||
form = $(this)
|
||||
@@ -21,7 +21,7 @@ App.WatchFormChanges =
|
||||
if App.WatchFormChanges.forms().length == 0 || App.WatchFormChanges.msg() == undefined
|
||||
return
|
||||
|
||||
$(document).off("page:before-change").on("page:before-change", (e) -> App.WatchFormChanges.checkChanges(e))
|
||||
$(document).off("page:before-change").on("page:before-change", -> App.WatchFormChanges.checkChanges())
|
||||
|
||||
App.WatchFormChanges.forms().each ->
|
||||
form = $(this)
|
||||
|
||||
Reference in New Issue
Block a user