Unified · Split
| @@ -171,7 +171,7 @@ onclick = (event) -> · 170 unmodified lines | |||
| 171 | return | 171 | return |
| 172 | 172 | ||
| 173 | link = event.target | 173 | link = event.target |
| 174 | link = link.parentElement while link and link.tagName isnt 'A' | 174 | link = link.parentNode while link and link.tagName isnt 'A' |
| 175 | 175 | ||
| 176 | if link and not link.target and isSameOrigin(link.href) | 176 | if link and not link.target and isSameOrigin(link.href) |
| 177 | event.preventDefault() | 177 | event.preventDefault() |
| @@ -16,13 +16,13 @@ $.hasChild = (parent, el) -> · 15 unmodified lines | |||
| 16 | while el | 16 | while el |
| 17 | return true if el is parent | 17 | return true if el is parent |
| 18 | return if el is document.body | 18 | return if el is document.body |
| 19 | el = el.parentElement | 19 | el = el.parentNode |
| 20 | 20 | ||
| 21 | $.closestLink = (el, parent = document.body) -> | 21 | $.closestLink = (el, parent = document.body) -> |
| 22 | while el | 22 | while el |
| 23 | return el if el.tagName is 'A' | 23 | return el if el.tagName is 'A' |
| 24 | return if el is parent | 24 | return if el is parent |
| 25 | el = el.parentElement | 25 | el = el.parentNode |
| 26 | 26 | ||
| 27 | # | 27 | # |
| 28 | # Events | 28 | # Events |
| @@ -96,7 +96,7 @@ $.before = (el, value) -> · 67 unmodified lines | |||
| 96 | if typeof value is 'string' or $.isCollection(value) | 96 | if typeof value is 'string' or $.isCollection(value) |
| 97 | value = buildFragment(value) | 97 | value = buildFragment(value) |
| 98 | 98 | ||
| 99 | el.parentElement.insertBefore(value, el) | 99 | el.parentNode.insertBefore(value, el) |
| 100 | return | 100 | return |
| 101 | 101 | ||
| 102 | $.after = (el, value) -> | 102 | $.after = (el, value) -> |
| @@ -104,16 +104,16 @@ $.after = (el, value) -> · 1 unmodified line | |||
| 104 | value = buildFragment(value) | 104 | value = buildFragment(value) |
| 105 | 105 | ||
| 106 | if el.nextSibling | 106 | if el.nextSibling |
| 107 | el.parentElement.insertBefore(value, el.nextSibling) | 107 | el.parentNode.insertBefore(value, el.nextSibling) |
| 108 | else | 108 | else |
| 109 | el.parentElement.appendChild(value) | 109 | el.parentNode.appendChild(value) |
| 110 | return | 110 | return |
| 111 | 111 | ||
| 112 | $.remove = (value) -> | 112 | $.remove = (value) -> |
| 113 | if $.isCollection(value) | 113 | if $.isCollection(value) |
| 114 | el.parentElement?.removeChild(el) for el in $.makeArray(value) | 114 | el.parentNode?.removeChild(el) for el in $.makeArray(value) |
| 115 | else | 115 | else |
| 116 | value.parentElement?.removeChild(value) | 116 | value.parentNode?.removeChild(value) |
| 117 | return | 117 | return |
| 118 | 118 | ||
| 119 | $.empty = (el) -> | 119 | $.empty = (el) -> |
| @@ -155,7 +155,7 @@ $.offset = (el, container = document.body) -> · 35 unmodified lines | |||
| 155 | left: left | 155 | left: left |
| 156 | 156 | ||
| 157 | $.scrollParent = (el) -> | 157 | $.scrollParent = (el) -> |
| 158 | while el = el.parentElement | 158 | while el = el.parentNode |
| 159 | break if el.scrollTop > 0 | 159 | break if el.scrollTop > 0 |
| 160 | break if getComputedStyle(el)?.overflowY in ['auto', 'scroll'] | 160 | break if getComputedStyle(el)?.overflowY in ['auto', 'scroll'] |
| 161 | el | 161 | el |
| @@ -46,8 +46,8 @@ class app.views.ListFocus extends app.View · 45 unmodified lines | |||
| 46 | @findNext(next) | 46 | @findNext(next) |
| 47 | else if next.tagName is 'H6' # title | 47 | else if next.tagName is 'H6' # title |
| 48 | @findNext(next) | 48 | @findNext(next) |
| 49 | else if cursor.parentElement isnt @el | 49 | else if cursor.parentNode isnt @el |
| 50 | @findNext cursor.parentElement | 50 | @findNext cursor.parentNode |
| 51 | 51 | ||
| 52 | findFirst: (cursor) -> | 52 | findFirst: (cursor) -> |
| 53 | return unless first = cursor.firstChild | 53 | return unless first = cursor.firstChild |
| @@ -72,8 +72,8 @@ class app.views.ListFocus extends app.View · 18 unmodified lines | |||
| 72 | @findPrev(prev) | 72 | @findPrev(prev) |
| 73 | else if prev.tagName is 'H6' # title | 73 | else if prev.tagName is 'H6' # title |
| 74 | @findPrev(prev) | 74 | @findPrev(prev) |
| 75 | else if cursor.parentElement isnt @el | 75 | else if cursor.parentNode isnt @el |
| 76 | @findPrev cursor.parentElement | 76 | @findPrev cursor.parentNode |
| 77 | 77 | ||
| 78 | findLast: (cursor) -> | 78 | findLast: (cursor) -> |
| 79 | return unless last = cursor.lastChild | 79 | return unless last = cursor.lastChild |
| @@ -101,8 +101,8 @@ class app.views.ListFocus extends app.View · 21 unmodified lines | |||
| 101 | 101 | ||
| 102 | onLeft: => | 102 | onLeft: => |
| 103 | cursor = @getCursor() | 103 | cursor = @getCursor() |
| 104 | if cursor and not cursor.classList.contains(app.views.ListFold.activeClass) and cursor.parentElement isnt @el | 104 | if cursor and not cursor.classList.contains(app.views.ListFold.activeClass) and cursor.parentNode isnt @el |
| 105 | @focusOnNextFrame cursor.parentElement.previousSibling | 105 | @focusOnNextFrame cursor.parentNode.previousSibling |
| 106 | return | 106 | return |
| 107 | 107 | ||
| 108 | onEnter: => | 108 | onEnter: => |
| @@ -55,11 +55,11 @@ class app.views.ListFold extends app.View · 54 unmodified lines | |||
| 55 | return if event.which isnt 1 or event.metaKey or event.ctrlKey | 55 | return if event.which isnt 1 or event.metaKey or event.ctrlKey |
| 56 | return unless event.pageY # ignore fabricated clicks | 56 | return unless event.pageY # ignore fabricated clicks |
| 57 | el = event.target | 57 | el = event.target |
| 58 | el = el.parentElement if el.parentElement.tagName.toUpperCase() is 'SVG' | 58 | el = el.parentNode if el.parentNode.tagName.toUpperCase() is 'SVG' |
| 59 | 59 | ||
| 60 | if el.classList.contains @constructor.handleClass | 60 | if el.classList.contains @constructor.handleClass |
| 61 | $.stopEvent(event) | 61 | $.stopEvent(event) |
| 62 | @toggle el.parentElement | 62 | @toggle el.parentNode |
| 63 | else if el.classList.contains @constructor.targetClass | 63 | else if el.classList.contains @constructor.targetClass |
| 64 | if el.hasAttribute('href') | 64 | if el.hasAttribute('href') |
| 65 | if el.classList.contains(@constructor.activeClass) | 65 | if el.classList.contains(@constructor.activeClass) |