Commit 23f8adb4 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Remove unnecessary dots from coffeescript

parent 18ad13ac
......@@ -20,7 +20,7 @@ document.querySelector('form:not(.nofocus)')?.querySelector('input')?.focus()
for e in document.querySelectorAll 'input[type=range]'
create_addon e
cb = -> @.nextElementSibling.innerHTML = @.value
cb = -> @nextElementSibling.innerHTML = @value
e.addEventListener 'change', cb
e.addEventListener 'input', cb
......@@ -30,11 +30,11 @@ for e in document.querySelectorAll 'input[type=range]'
for e in document.querySelectorAll 'input[type^=date]'
addon = create_addon e
addon.innerHTML = '<span class="glyphicon glyphicon-calendar"></span>'
addon.addEventListener 'click', -> @.previousElementSibling.focus()
addon.addEventListener 'click', -> @previousElementSibling.focus()
# always select the whole number on a number type input to avoid backspacing
for e in document.querySelectorAll 'input[type=number]'
e.addEventListener 'focus', -> @.select()
e.addEventListener 'focus', -> @select()
# inline radio labels
for e in document.querySelectorAll '.radio > label > input[type=radio][data-inline]'
......@@ -46,12 +46,12 @@ for e in document.querySelectorAll '.radio > label > input[type=radio][data-inli
# make abbreviations clickable on mobile devices (since there is no hover)
if /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test navigator.userAgent
for e in document.getElementsByTagName 'abbr'
e.addEventListener 'click', -> alert @.getAttribute 'title'
e.addEventListener 'click', -> alert @getAttribute 'title'
# allow table rows to be links through the data-href attribute
for e in document.querySelectorAll '[data-href]'
e.addEventListener 'click', ->
document.location = @.getAttribute 'data-href'
document.location = @getAttribute 'data-href'
# fix class names on select boxes with multiple="multiple"
for e in document.querySelectorAll 'select[multiple]'
......
......@@ -49,12 +49,12 @@ if table.classList.contains 'match-editable'
((col, row) ->
cell = input.parentNode
cb = ->
value = num @.value
value = num @value
if set_score col, row, value
cell.dataset.score = value
if value != 10
@.nextElementSibling.value = 0
@.parentNode.querySelector('.cross-popup')
@nextElementSibling.value = 0
@parentNode.querySelector('.cross-popup')
.classList.remove 'enabled'
input.addEventListener 'change', cb
input.addEventListener 'keyup', cb
......@@ -77,8 +77,8 @@ if table.classList.contains 'match-editable'
toggle_totals.classList.remove 'active'
toggle_totals.addEventListener 'click', ->
@.classList.toggle 'active'
@.blur()
@classList.toggle 'active'
@blur()
hide = table.classList.toggle 'hide-total-scores'
if 'localStorage' of window
......@@ -91,8 +91,8 @@ if table.classList.contains 'match-editable'
# notes area grows automatically with each added line
if notes = document.getElementById('notes')
cb = ->
@.style.height = 0
@.style.height = @.scrollHeight + 'px'
@style.height = 0
@style.height = @scrollHeight + 'px'
notes.addEventListener 'keyup', cb
cb.call notes
......@@ -104,8 +104,8 @@ if 'localStorage' of window and localStorage.getItem 'colored-scores'
toggle_color.classList.add 'active'
toggle_color.addEventListener 'click', ->
@.classList.toggle 'active'
@.blur()
@classList.toggle 'active'
@blur()
colored = table.classList.toggle 'colored'
if 'localStorage' of window
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment