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() ...@@ -20,7 +20,7 @@ document.querySelector('form:not(.nofocus)')?.querySelector('input')?.focus()
for e in document.querySelectorAll 'input[type=range]' for e in document.querySelectorAll 'input[type=range]'
create_addon e create_addon e
cb = -> @.nextElementSibling.innerHTML = @.value cb = -> @nextElementSibling.innerHTML = @value
e.addEventListener 'change', cb e.addEventListener 'change', cb
e.addEventListener 'input', cb e.addEventListener 'input', cb
...@@ -30,11 +30,11 @@ for e in document.querySelectorAll 'input[type=range]' ...@@ -30,11 +30,11 @@ for e in document.querySelectorAll 'input[type=range]'
for e in document.querySelectorAll 'input[type^=date]' for e in document.querySelectorAll 'input[type^=date]'
addon = create_addon e addon = create_addon e
addon.innerHTML = '<span class="glyphicon glyphicon-calendar"></span>' 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 # always select the whole number on a number type input to avoid backspacing
for e in document.querySelectorAll 'input[type=number]' for e in document.querySelectorAll 'input[type=number]'
e.addEventListener 'focus', -> @.select() e.addEventListener 'focus', -> @select()
# inline radio labels # inline radio labels
for e in document.querySelectorAll '.radio > label > input[type=radio][data-inline]' 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 ...@@ -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) # 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 if /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test navigator.userAgent
for e in document.getElementsByTagName 'abbr' 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 # allow table rows to be links through the data-href attribute
for e in document.querySelectorAll '[data-href]' for e in document.querySelectorAll '[data-href]'
e.addEventListener 'click', -> e.addEventListener 'click', ->
document.location = @.getAttribute 'data-href' document.location = @getAttribute 'data-href'
# fix class names on select boxes with multiple="multiple" # fix class names on select boxes with multiple="multiple"
for e in document.querySelectorAll 'select[multiple]' for e in document.querySelectorAll 'select[multiple]'
......
...@@ -49,12 +49,12 @@ if table.classList.contains 'match-editable' ...@@ -49,12 +49,12 @@ if table.classList.contains 'match-editable'
((col, row) -> ((col, row) ->
cell = input.parentNode cell = input.parentNode
cb = -> cb = ->
value = num @.value value = num @value
if set_score col, row, value if set_score col, row, value
cell.dataset.score = value cell.dataset.score = value
if value != 10 if value != 10
@.nextElementSibling.value = 0 @nextElementSibling.value = 0
@.parentNode.querySelector('.cross-popup') @parentNode.querySelector('.cross-popup')
.classList.remove 'enabled' .classList.remove 'enabled'
input.addEventListener 'change', cb input.addEventListener 'change', cb
input.addEventListener 'keyup', cb input.addEventListener 'keyup', cb
...@@ -77,8 +77,8 @@ if table.classList.contains 'match-editable' ...@@ -77,8 +77,8 @@ if table.classList.contains 'match-editable'
toggle_totals.classList.remove 'active' toggle_totals.classList.remove 'active'
toggle_totals.addEventListener 'click', -> toggle_totals.addEventListener 'click', ->
@.classList.toggle 'active' @classList.toggle 'active'
@.blur() @blur()
hide = table.classList.toggle 'hide-total-scores' hide = table.classList.toggle 'hide-total-scores'
if 'localStorage' of window if 'localStorage' of window
...@@ -91,8 +91,8 @@ if table.classList.contains 'match-editable' ...@@ -91,8 +91,8 @@ if table.classList.contains 'match-editable'
# notes area grows automatically with each added line # notes area grows automatically with each added line
if notes = document.getElementById('notes') if notes = document.getElementById('notes')
cb = -> cb = ->
@.style.height = 0 @style.height = 0
@.style.height = @.scrollHeight + 'px' @style.height = @scrollHeight + 'px'
notes.addEventListener 'keyup', cb notes.addEventListener 'keyup', cb
cb.call notes cb.call notes
...@@ -104,8 +104,8 @@ if 'localStorage' of window and localStorage.getItem 'colored-scores' ...@@ -104,8 +104,8 @@ if 'localStorage' of window and localStorage.getItem 'colored-scores'
toggle_color.classList.add 'active' toggle_color.classList.add 'active'
toggle_color.addEventListener 'click', -> toggle_color.addEventListener 'click', ->
@.classList.toggle 'active' @classList.toggle 'active'
@.blur() @blur()
colored = table.classList.toggle 'colored' colored = table.classList.toggle 'colored'
if 'localStorage' of window 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