aa7fc8a84be92b363a0d6c33ec22710be0ba88df
[ccsdk/features.git] /
1 (function( $, app ) {
2
3         var ui = app.ns("ui");
4
5         ui.MenuButton = app.ui.Button.extend({
6                 defaults: {
7                         menu: null
8                 },
9                 _baseCls: "uiButton uiMenuButton",
10                 init: function(parent) {
11                         this._super(parent);
12                         this.menu = this.config.menu;
13                         this.on("click", this.openMenu_handler);
14                         this.menu.on("open", function() { this.el.addClass("active"); }.bind(this));
15                         this.menu.on("close", function() { this.el.removeClass("active"); }.bind(this));
16                 },
17                 openMenu_handler: function(jEv) {
18                         this.menu && this.menu.open(jEv);
19                 }
20         });
21
22 })( this.jQuery, this.app );