/*** * Content dropdowns */ this.ContentDropdown = function($element) { var STATE_DROPDOWN_OPEN = 1; var STATE_DROPDOWN_CLOSE = 2; this.$element = $element; this.state = STATE_DROPDOWN_CLOSE; this.bindEventListeners(); } ContentDropdown.prototype.bindEventListeners = function() { var $this = this; this.$element.find('.content-dropdown__title').on('click', function() { $this.$element.toggleClass("content-dropdown--open"); }) }; this.ContentDropdownContainer = function($element) { var $this = this; $this.$container = $element; $this.dropdowns = []; $this.$container.find('.content-dropdown').each(function() { $this.dropdowns.push(new ContentDropdown($(this))); }); }