📄 myportalcontextmenu.js
字号:
var MyPortalContextMenu = {
contextMenu : null,
Hide : function()
{
if (this.contextMenu)
{
this.contextMenu.style.display = "none";
}
},
Show : function(e, contextMenuId)
{
var x = document.body.scrollLeft + document.documentElement.scrollLeft + e.clientX;
var y = document.body.scrollTop + document.documentElement.scrollTop + e.clientY;
if (!this.contextMenu)
{
this.contextMenu = document.getElementById(contextMenuId);
}
var cmTable = this.contextMenu;
var rows = cmTable.rows;
for (var i = 0; i < rows.length; i++)
{
this.SetItemState(rows[i]);
}
cmTable.style.display = "";
cmTable.style.top = (y + "px");
cmTable.style.left = (x + "px");
},
SetItemState : function(menuItem)
{
var id = menuItem.getAttribute("id").substr(this.ItemPrefix.length,menuItem.getAttribute("id").length);
var dockableObject = document.getElementById(id);
if (!dockableObject)
return;
var isVisible = (dockableObject.style.display != "none");
menuItem.cells[0].childNodes[0].style.visibility = isVisible ? "" : "hidden";
menuItem.className = "";
},
ItemClicked : function(menuItem)
{
var id = menuItem.getAttribute("id").substr(this.ItemPrefix.length,menuItem.getAttribute("id").length);
var dockableObject = document.getElementById(id);
if (!dockableObject)
return;
dockableObject.Show(!dockableObject.IsVisible());
},
ItemPrefix : '___'
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -