function meTrapFocus(container, options) {

    var that = this;

    // check arguments
    var containerElement = container && meTools.getElementById(container);
    if (!containerElement) {
      throw new Error('meTrapFocus: Container element not found');
    }

    // merge options
    initProperties.call(that).options = meTools.mergeObjects(defaultOptions, options);

    // prepare container
    that.container = containerElement;
    if (!containerElement.hasAttribute('tabindex')) { // add tabindex to the container, so that it can get focus onClick and receives tab-events as target (to prevent tabbing out)
      container.setAttribute('data-tabindexed', 'true');
      containerElement.setAttribute('tabindex', '-1');
    }
    meTools.registerEvent(that, containerElement, 'keydown', function (event) {
      handleKeyboard.call(that, event);
    });

    fetchFocusables.call(that);

  }
/**
   * Create a new instance
   * @param container mixed; id or element; the container in which the focus should be maintained
   * @param options object; optional; overwrite the default options
   */
Create a new instance
@param container mixed; id or element; the container in which the focus should be maintained
@param options object; optional; overwrite the default options
Create a new instance @param container mixed ; id or element ; the container in which the focus should be maintained @param options object ; optional ; overwrite the default options
function meTrapFocus(container, options) {
    var that = this;
    var containerElement = container && meTools.getElementById(container);
    if (!containerElement) {
      throw new Error('meTrapFocus: Container element not found');
    }
    initProperties.call(that).options = meTools.mergeObjects(defaultOptions, options);
    that.container = containerElement;
    if (!containerElement.hasAttribute('tabindex')) { 
      container.setAttribute('data-tabindexed', 'true');
      containerElement.setAttribute('tabindex', '-1');
    }
    meTools.registerEvent(that, containerElement, 'keydown', function (event) {
      handleKeyboard.call(that, event);
    });
    fetchFocusables.call(that);
  }
function meTrapFocus ( container , options ) { var that = this ; var containerElement = container && meTools . getElementById ( container ) ; if ( ! containerElement ) { throw new Error ( 'meTrapFocus: Container element not found' ) ; } initProperties . call ( that ) . options = meTools . mergeObjects ( defaultOptions , options ) ; that . container = containerElement ; if ( ! containerElement . hasAttribute ( 'tabindex' ) ) { container . setAttribute ( 'data-tabindexed' , 'true' ) ; containerElement . setAttribute ( 'tabindex' , '-1' ) ; } meTools . registerEvent ( that , containerElement , 'keydown' , function ( event ) { handleKeyboard . call ( that , event ) ; } ) ; fetchFocusables . call ( that ) ; }
Create a new instance
 @param container mixed; id or element; the container in which the focus should be maintained
 @param options object; optional; overwrite the default options
Create a new instance @param container mixed ; id or element ; the container in which the focus should be maintained @param options object ; optional ; overwrite the default options
// check arguments // merge options // prepare container // add tabindex to the container, so that it can get focus onClick and receives tab-events as target (to prevent tabbing out)