corregido error popover
This commit is contained in:
parent
e4e01c4970
commit
53af148def
|
@ -136,13 +136,14 @@ export class Popover {
|
|||
}
|
||||
this._checkOpens();
|
||||
}
|
||||
hideOthers(id) {
|
||||
hideChilds(id) {
|
||||
let popovers = this.document.querySelectorAll('*[id^="popover-"]');
|
||||
let idNumber = parseInt(id.split('-')[1], 10);
|
||||
popovers.forEach(
|
||||
val => {
|
||||
if (angular.element(val).attr('id') != id) {
|
||||
let valId = angular.element(val).attr('id');
|
||||
if (parseInt(valId.split('-')[1], 10) > idNumber)
|
||||
this._removeElement(val);
|
||||
}
|
||||
}
|
||||
);
|
||||
this._checkOpens();
|
||||
|
@ -169,7 +170,7 @@ export class Popover {
|
|||
onDocMouseDown(event) {
|
||||
let targetId = this._findParent(event.target);
|
||||
if (targetId) {
|
||||
this.hideOthers(targetId);
|
||||
this.hideChilds(targetId);
|
||||
} else {
|
||||
this.hideAll();
|
||||
}
|
||||
|
@ -178,7 +179,7 @@ export class Popover {
|
|||
if (event.keyCode === 27) {
|
||||
let targetId = this._findParent(this.latTarget);
|
||||
if (targetId) {
|
||||
this.hideOthers(targetId);
|
||||
this.hideChilds(targetId);
|
||||
} else {
|
||||
this.hideAll();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue