function DragNBar(buttons, $container, $dialogContainer, options) {
    var self = this;

    EventDispatcher.call(this);
    this.overflowThreshold = 13; // How many buttons to display before we add the more button.
    this.buttons = buttons;
    this.$container = $container;
    this.$dialogContainer = $dialogContainer;
    this.dnd = new H5P.DragNDrop(this, $container);
    this.dnd.snap = 10;
    this.newElement = false;
    var defaultOptions = {
      disableEditor: false
    };
    options = H5P.jQuery.extend(defaultOptions, options);
    this.isEditor = !options.disableEditor;
    this.$blurHandlers = options.$blurHandlers ? options.$blurHandlers : undefined;

    /**
     * Keeps track of created DragNBar elements
     * @type {Array}
     */
    this.elements = [];

    // Create a popup dialog
    this.dialog = new H5P.DragNBarDialog($dialogContainer, $container);

    // Fix for forcing redraw on $container, to avoid "artifcats" on safari
    this.$container.addClass('hardware-accelerated');

    if (this.isEditor) {
      this.transformButtonActive = false;
      this.initEditor();
      this.initClickListeners();

      H5P.$window.resize(function () {
        self.resize();
      });
    }
  }
/**
   * Constructor. Initializes the drag and drop menu bar.
   *
   * @class
   * @param {Array} buttons
   * @param {H5P.jQuery} $container
   * @param {H5P.jQuery} $dialogContainer
   * @param {object} [options] Collection of options
   * @param {boolean} [options.disableEditor=false] Determines if DragNBar should be displayed in view or editor mode
   * @param {H5P.jQuery} [options.$blurHandlers] When clicking these element(s) dnb focus will be lost
   */
Constructor. Initializes the drag and drop menu bar.
Constructor . Initializes the drag and drop menu bar .
function DragNBar(buttons, $container, $dialogContainer, options) {
    var self = this;
    EventDispatcher.call(this);
    this.overflowThreshold = 13; 
    this.buttons = buttons;
    this.$container = $container;
    this.$dialogContainer = $dialogContainer;
    this.dnd = new H5P.DragNDrop(this, $container);
    this.dnd.snap = 10;
    this.newElement = false;
    var defaultOptions = {
      disableEditor: false
    };
    options = H5P.jQuery.extend(defaultOptions, options);
    this.isEditor = !options.disableEditor;
    this.$blurHandlers = options.$blurHandlers ? options.$blurHandlers : undefined;
    this.elements = [];
    this.dialog = new H5P.DragNBarDialog($dialogContainer, $container);
    this.$container.addClass('hardware-accelerated');
    if (this.isEditor) {
      this.transformButtonActive = false;
      this.initEditor();
      this.initClickListeners();
      H5P.$window.resize(function () {
        self.resize();
      });
    }
  }
function DragNBar ( buttons , $container , $dialogContainer , options ) { var self = this ; EventDispatcher . call ( this ) ; this . overflowThreshold = 13 ; this . buttons = buttons ; this . $container = $container ; this . $dialogContainer = $dialogContainer ; this . dnd = new H5P . DragNDrop ( this , $container ) ; this . dnd . snap = 10 ; this . newElement = false ; var defaultOptions = { disableEditor : false } ; options = H5P . jQuery . extend ( defaultOptions , options ) ; this . isEditor = ! options . disableEditor ; this . $blurHandlers = options . $blurHandlers ? options . $blurHandlers : undefined ; this . elements = [ ] ; this . dialog = new H5P . DragNBarDialog ( $dialogContainer , $container ) ; this . $container . addClass ( 'hardware-accelerated' ) ; if ( this . isEditor ) { this . transformButtonActive = false ; this . initEditor ( ) ; this . initClickListeners ( ) ; H5P . $window . resize ( function ( ) { self . resize ( ) ; } ) ; } }
Constructor.
Constructor .
// How many buttons to display before we add the more button. /**
     * Keeps track of created DragNBar elements
     * @type {Array}
     */ // Create a popup dialog // Fix for forcing redraw on $container, to avoid "artifcats" on safari