禁止鼠标右键菜单

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, "MaxProcs": 4,
"RuntimeMode": "dev", "RuntimeMode": "dev",
"Pwd": "{pwd}", "Pwd": "{pwd}",
"Workspace": "{pwd}/data/workspace",
"Users": [ "Users": [
{ {
"Name": "admin", "Name": "admin",
"Password": "admin", "Password": "admin",
"Workspace": "{pwd}/data/user_workspaces/admin", "Workspace": "{pwd}/data/user_workspaces/admin",
"LatestSessionContent": { "LatestSessionContent": {
"FileTree": [], "FileTree": [
"Files": [], "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest",
"CurrentFile": "" "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(); this._initBottomWindowGroup();
// 点击隐藏弹出层
$("body").bind("mousedown", function (event) { $("body").bind("mousedown", function (event) {
if (!(event.target.id === "dirRMenu" || $(event.target).closest("#dirRMenu").length > 0)) { if (!(event.target.id === "dirRMenu" || $(event.target).closest("#dirRMenu").length > 0)) {
$("#dirRMenu").hide(); $("#dirRMenu").hide();
@ -383,12 +384,18 @@ var wide = {
} }
}); });
// 刷新提示
window.onbeforeunload = function () { window.onbeforeunload = function () {
if (editors.data.length > 0) { if (editors.data.length > 0) {
return config.label.confirm_save; return config.label.confirm_save;
} }
}; };
// 禁止鼠标右键菜单
document.oncontextmenu = function () {
return false;
};
this._initDialog(); this._initDialog();
this._initLayout(); this._initLayout();