禁止鼠标右键菜单

This commit is contained in:
Van 2014-10-21 15:11:28 +08:00
parent dd500f4f3f
commit 78e34fed06
2 changed files with 15 additions and 4 deletions

View File

@ -10,16 +10,20 @@
"MaxProcs": 4,
"RuntimeMode": "dev",
"Pwd": "{pwd}",
"Workspace": "{pwd}/data/workspace",
"Users": [
{
"Name": "admin",
"Password": "admin",
"Workspace": "{pwd}/data/user_workspaces/admin",
"LatestSessionContent": {
"FileTree": [],
"Files": [],
"CurrentFile": ""
"FileTree": [
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest",
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello"
],
"Files": [
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go"
],
"CurrentFile": "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go"
}
}
]

View File

@ -367,6 +367,7 @@ var wide = {
this._initBottomWindowGroup();
// 点击隐藏弹出层
$("body").bind("mousedown", function (event) {
if (!(event.target.id === "dirRMenu" || $(event.target).closest("#dirRMenu").length > 0)) {
$("#dirRMenu").hide();
@ -383,11 +384,17 @@ var wide = {
}
});
// 刷新提示
window.onbeforeunload = function () {
if (editors.data.length > 0) {
return config.label.confirm_save;
}
};
// 禁止鼠标右键菜单
document.oncontextmenu = function () {
return false;
};
this._initDialog();