/** This view handles rendering of a button with an associated drop down @class DropdownButtonView @extends Discourse.View @namespace Discourse @module Discourse **/ Discourse.DropdownButtonView = Discourse.View.extend({ classNames: ['btn-group'], attributeBindings: ['data-not-implemented'], didInsertElement: function(e) { // If there's a click handler, call it if (this.clicked) { var dropDownButtonView = this; this.$('ul li').on('click.dropdown-button', function(e) { e.preventDefault(); dropDownButtonView.clicked($(e.currentTarget).data('id')); return false; }); } }, willDestroyElement: function(e) { this.$('ul li').off('click.dropdown-button'); }, textChanged: function() { this.rerender(); }.observes('text', 'longDescription'), render: function(buffer) { buffer.push("
"); buffer.push(desc); buffer.push("
"); } } });