SU-SWS/decanter

View on GitHub
core/src/js/components/secondary-nav/common/events/OnArrowUp.js

Summary

Maintainability
A
3 hrs
Test Coverage
import EventAbstract from './EventAbstract';
import OnEnd from './OnEnd';

/**
 * OnArrowUp
 *
 * Event action handler class.
 */
export default class OnArrowUp extends EventAbstract {

  /**
   * Execute the action to the event.
   */
  exec() {
    this.event.preventDefault();

    // Go to the previous item.
    let node = this.getElement('prev');
    if (node) {
      node.focus();
      return;
    }

    // Default to the end..
    var eventEnd = new OnEnd(this.item, this.event, this.target);
    eventEnd.init();

  }
}