Strict mode is supported by 98% of the browsers, including Internet Explorer 10, and it helps developers avoid common JavaScript pitfalls.
13 lines
343 B
CoffeeScript
13 lines
343 B
CoffeeScript
"use strict"
|
|
|
|
App.CheckAllNone =
|
|
|
|
initialize: ->
|
|
$("[data-check-all]").on "click", ->
|
|
target_name = $(this).data("check-all")
|
|
$("[name='#{target_name}']").prop("checked", true)
|
|
|
|
$("[data-check-none]").on "click", ->
|
|
target_name = $(this).data("check-none")
|
|
$("[name='#{target_name}']").prop("checked", false)
|