[common] don't open context menu if no items
This commit is contained in:
parent
2bd901f3a6
commit
a9dda7fe6f
|
@ -109,10 +109,11 @@ class ContextMenuController extends Component {
|
||||||
extraItems: this.initExtraItems()
|
extraItems: this.initExtraItems()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ( this.state.items.length > 0 ) {
|
||||||
this.$targetEl.css({left: `${x}px`, top: `${y}px`});
|
this.$targetEl.css({left: `${x}px`, top: `${y}px`});
|
||||||
const popover = f7.popover.open(idContextMenuElement, idCntextMenuTargetElement);
|
const popover = f7.popover.open(idContextMenuElement, idCntextMenuTargetElement);
|
||||||
|
|
||||||
if ( Device.android )
|
if (Device.android)
|
||||||
this.offsetPopoverTop(popover);
|
this.offsetPopoverTop(popover);
|
||||||
|
|
||||||
this.setState(state => {
|
this.setState(state => {
|
||||||
|
@ -120,6 +121,7 @@ class ContextMenuController extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onApiHideContextMenu() {
|
onApiHideContextMenu() {
|
||||||
if ( this.state.opened ) {
|
if ( this.state.opened ) {
|
||||||
|
|
Loading…
Reference in a new issue