ng2-material-dropdown
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -309,2 +309,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
this.state.menuState.isVisible = true; | ||
this.listeners.handleKeypress = this.renderer.listen(document.body, 'keydown', this.handleKeypress.bind(this)); | ||
this.listeners.arrowHandler = this.renderer.listen(window, 'keydown', actions_1.arrowKeysHandler); | ||
@@ -316,2 +317,3 @@ }; | ||
this.listeners.arrowHandler(); | ||
this.listeners.handleKeypress(); | ||
}; | ||
@@ -323,5 +325,2 @@ Ng2DropdownMenu.prototype.updatePosition = function (position) { | ||
Ng2DropdownMenu.prototype.handleKeypress = function ($event) { | ||
if (this.state.menuState.isVisible === false) { | ||
return; | ||
} | ||
var key = $event.keyCode; | ||
@@ -380,7 +379,5 @@ var items = this.items.toArray(); | ||
Ng2DropdownMenu.prototype.ngOnInit = function () { | ||
var body = document.querySelector('body'); | ||
if (this.appendToBody) { | ||
body.appendChild(this.element.nativeElement); | ||
document.body.appendChild(this.element.nativeElement); | ||
} | ||
this.listeners.handleKeypress = this.renderer.listen(body, 'keyup', this.handleKeypress.bind(this)); | ||
}; | ||
@@ -387,0 +384,0 @@ Ng2DropdownMenu.prototype.ngDoCheck = function () { |
@@ -29,2 +29,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.state.menuState.isVisible = true; | ||
this.listeners.handleKeypress = this.renderer.listen(document.body, 'keydown', this.handleKeypress.bind(this)); | ||
this.listeners.arrowHandler = this.renderer.listen(window, 'keydown', arrowKeysHandler); | ||
@@ -36,2 +37,3 @@ }; | ||
this.listeners.arrowHandler(); | ||
this.listeners.handleKeypress(); | ||
}; | ||
@@ -43,5 +45,2 @@ Ng2DropdownMenu.prototype.updatePosition = function (position) { | ||
Ng2DropdownMenu.prototype.handleKeypress = function ($event) { | ||
if (this.state.menuState.isVisible === false) { | ||
return; | ||
} | ||
var key = $event.keyCode; | ||
@@ -100,7 +99,5 @@ var items = this.items.toArray(); | ||
Ng2DropdownMenu.prototype.ngOnInit = function () { | ||
var body = document.querySelector('body'); | ||
if (this.appendToBody) { | ||
body.appendChild(this.element.nativeElement); | ||
document.body.appendChild(this.element.nativeElement); | ||
} | ||
this.listeners.handleKeypress = this.renderer.listen(body, 'keyup', this.handleKeypress.bind(this)); | ||
}; | ||
@@ -107,0 +104,0 @@ Ng2DropdownMenu.prototype.ngDoCheck = function () { |
{ | ||
"name": "ng2-material-dropdown", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Angular 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
Sorry, the diff of this file is not supported yet
176649
1524