Sha256: 83aadec3abd2573d1ce5157880b238650559037a6e1b06b3073fc3a7bfa62e5c

Contents?: true

Size: 783 Bytes

Versions: 9

Compression:

Stored size: 783 Bytes

Contents

(function($) {
  var BAR_MIN_WIDTH = 65;

  pageflow.outlineNavigationBar.Resizer = pageflow.Object.extend({
    initialize: function(element, options) {
      this.element = element;
      this.options = options;

      this.list = this.element.find('.chapters_panel ul');

      this._setupWidth();
    },

    _setupWidth: function() {
      this.expandedWidth = Math.max(BAR_MIN_WIDTH, this.list.width()) + 'px';

      if (this.options.isFixed) {
        this.element.css('width', this.expandedWidth);
      }
    },

    expand: function() {
      this.element.addClass('expanded');
      this.element.css('width', this.expandedWidth);
    },

    collapse: function() {
      this.element.removeClass('expanded');
      this.element.css('width', '');
    },
  });
}(jQuery));

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pageflow-outline-navigation-bar-1.6.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.5.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.4.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.3.1 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.3.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.2.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.1.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-1.0.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js
pageflow-outline-navigation-bar-0.1.0 app/assets/javascript/pageflow/outline_navigation_bar/resizer.js