mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-07-31 02:20:18 +02:00
Update context menu.
This commit is contained in:
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
|
|
||||||
.cm-panel {
|
.cm-panel {
|
||||||
|
.popup();
|
||||||
|
.rounded();
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 100px;
|
left: 100px;
|
||||||
@@ -21,7 +23,6 @@
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
color: @col;
|
color: @col;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
box-shadow: 0 0 20px 0 rgba(0,0,0,0.2);
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: @col-hover;
|
color: @col-hover;
|
||||||
background: rgba(0,0,0,0.05);
|
background: @col-darkgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-icon {
|
.cm-icon {
|
||||||
|
@@ -94,6 +94,10 @@
|
|||||||
box-shadow: 0 1px 10px 0 rgba(0,0,0,0.5);
|
box-shadow: 0 1px 10px 0 rgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popup() {
|
||||||
|
box-shadow: 0 1px 20px 0 rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
.rounded() {
|
.rounded() {
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
modulejs.define('ext/contextmenu', ['$', '_', 'core/resource'], function ($, _, resource) {
|
modulejs.define('ext/contextmenu', ['_', '$', 'core/settings', 'core/resource'], function (_, $, allsettings, resource) {
|
||||||
|
|
||||||
|
|
||||||
|
var settings = _.extend({
|
||||||
|
enabled: false
|
||||||
|
}, allsettings.contextmenu);
|
||||||
var templateOverlay = '<div class="cm-overlay"/>';
|
var templateOverlay = '<div class="cm-overlay"/>';
|
||||||
var templatePanel = '<div class="cm-panel"><ul/></div>';
|
var templatePanel = '<div class="cm-panel"><ul/></div>';
|
||||||
var templateSep = '<li class="cm-sep"/>';
|
var templateSep = '<li class="cm-sep"/>';
|
||||||
@@ -135,6 +137,10 @@ modulejs.define('ext/contextmenu', ['$', '_', 'core/resource'], function ($, _,
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
|
if (!settings.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).on('contextmenu', function (ev) {
|
$(document).on('contextmenu', function (ev) {
|
||||||
|
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
@@ -59,6 +59,13 @@ Options
|
|||||||
"interval": 5000
|
"interval": 5000
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
Use a context menu (right-click) on selected elements.
|
||||||
|
*/
|
||||||
|
"contextmenu": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Show a clickable breadcrumb.
|
Show a clickable breadcrumb.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user