diff options
Diffstat (limited to 'sdnr/wt/devicemanager/provider/src/test/resources/elasticsearch/plugins/head/src/app/ui/menuButton/menuButton.js')
-rw-r--r-- | sdnr/wt/devicemanager/provider/src/test/resources/elasticsearch/plugins/head/src/app/ui/menuButton/menuButton.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/provider/src/test/resources/elasticsearch/plugins/head/src/app/ui/menuButton/menuButton.js b/sdnr/wt/devicemanager/provider/src/test/resources/elasticsearch/plugins/head/src/app/ui/menuButton/menuButton.js new file mode 100644 index 000000000..aa7fc8a84 --- /dev/null +++ b/sdnr/wt/devicemanager/provider/src/test/resources/elasticsearch/plugins/head/src/app/ui/menuButton/menuButton.js @@ -0,0 +1,22 @@ +(function( $, app ) { + + var ui = app.ns("ui"); + + ui.MenuButton = app.ui.Button.extend({ + defaults: { + menu: null + }, + _baseCls: "uiButton uiMenuButton", + init: function(parent) { + this._super(parent); + this.menu = this.config.menu; + this.on("click", this.openMenu_handler); + this.menu.on("open", function() { this.el.addClass("active"); }.bind(this)); + this.menu.on("close", function() { this.el.removeClass("active"); }.bind(this)); + }, + openMenu_handler: function(jEv) { + this.menu && this.menu.open(jEv); + } + }); + +})( this.jQuery, this.app ); |