I have a table where by clicking any row I can access context menu
<tr oncontextmenu="return showContextMenu(event,'@item.SomeValue')" style="cursor: pointer;">
The event of showing the context menu looks like this:
var contextMenu = document.getElementById('contextMenu');
function showContextMenu(event, elemId) {
contextMenu.style.display = 'block';
contextMenu.style.left = (event.pageX - 220) + 'px';
contextMenu.style.top = (event.pageY - 48) + 'px';
}
and event of closing context menu this way:
window.onclick = hideContextMenu;
function hideContextMenu() {
contextMenu.style.display = 'none';
}
The context menu looks like this:
<div id="contextMenuPasta" class="contextMenu" >
<ul>
<li id="renomearCMid" data-toggle="modal" data-target="#modalRenomearPasta"><span><i class="fa fa-fw fa-pencil" ></i> Renomear Pasta</span></li>
<li id="removerCMid" data-toggle="modal" data-target="#modalExcluirPasta"><span><i class="fa fa-fw fa-trash-o"></i> Remover Pasta</span></li>
<li id="adicionarCMid" data-toggle="modal" data-target="#modalNovaPasta"><span><i class="fa fa-fw fa-plus"></i> Adicionar Pasta</span></li>
</ul>
</div>
Is there any way to change right click mouse to the left click, in order to show context menu? Thank You for help.