Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/behavior-watch-anchor.js
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | function seek_anchor() { | ||||
| // If we've found a new target, highlight it. | // If we've found a new target, highlight it. | ||||
| if (target !== node) { | if (target !== node) { | ||||
| target = node; | target = node; | ||||
| // If there's an "anchor-container" parent element, we'll make the | // If there's an "anchor-container" parent element, we'll make the | ||||
| // display adjustment to that node instead. For example, this is used | // display adjustment to that node instead. For example, this is used | ||||
| // by the timeline to highlight timeline stories. | // by the timeline to highlight timeline stories. | ||||
| var container = JX.DOM.findAbove(node, null, 'anchor-container'); | |||||
| var container; | |||||
| try { | |||||
| container = JX.DOM.findAbove(node, null, 'anchor-container'); | |||||
| } catch (ex) { | |||||
| // Ignore. | |||||
| } | |||||
| if (container) { | if (container) { | ||||
| display_target = container; | display_target = container; | ||||
| } else { | } else { | ||||
| display_target = node; | display_target = node; | ||||
| } | } | ||||
| JX.DOM.alterClass(display_target, 'anchor-target', true); | JX.DOM.alterClass(display_target, 'anchor-target', true); | ||||
| } | } | ||||
| Show All 13 Lines | |||||