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