ng2-material-dropdown
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -94,8 +94,17 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
} | ||
Ng2Dropdown.prototype.toggleMenu = function (position) { | ||
Ng2Dropdown.prototype.toggleMenu = function (position, focus) { | ||
if (position === void 0) { position = this.button.getPosition(); } | ||
var isVisible = this.menu.state.isVisible; | ||
isVisible ? this.menu.hide() : this.menu.show(); | ||
if (focus === void 0) { focus = true; } | ||
this.menu.state.isVisible ? this.hide() : this.show(position, focus); | ||
}; | ||
Ng2Dropdown.prototype.hide = function () { | ||
this.menu.hide(); | ||
this.onHide.emit(this); | ||
}; | ||
Ng2Dropdown.prototype.show = function (position, focus) { | ||
if (position === void 0) { position = this.button.getPosition(); } | ||
if (focus === void 0) { focus = true; } | ||
this.menu.show(focus); | ||
this.menu.updatePosition(position); | ||
isVisible ? this.onHide.emit(this) : this.onShow.emit(this); | ||
this.onShow.emit(this); | ||
}; | ||
@@ -109,3 +118,3 @@ Ng2Dropdown.prototype.ngOnInit = function () { | ||
} | ||
_this.toggleMenu(); | ||
_this.hide.call(_this); | ||
}); | ||
@@ -112,0 +121,0 @@ if (this.button) { |
{ | ||
"name": "ng2-material-dropdown", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Angular 2 material-like Dropdown Component", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
93805
1018