ctrl+click quick view

This commit is contained in:
Yuri Kuznetsov
2022-08-20 12:34:42 +03:00
parent fe0570b0c4
commit 5365640ca8
2 changed files with 33 additions and 1 deletions
@@ -5,7 +5,7 @@
class="btn btn-link btn-sm dropdown-toggle"
data-toggle="dropdown"
><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu pull-right list-row-dropdown-menu" data-id="{{model.id}}">
{{#each actionList}}
<li>
<a
+32
View File
@@ -430,6 +430,7 @@ function (Dep, MassActionHelper, ExportHelper) {
* @this module:views/record/list.Class
*/
'click a.link': function (e) {
console.log(e);
if (e.ctrlKey || e.metaKey || e.shiftKey) {
return;
}
@@ -458,6 +459,37 @@ function (Dep, MassActionHelper, ExportHelper) {
this.getRouter().navigate('#' + scope + '/view/' + id, {trigger: false});
this.getRouter().dispatch(scope, 'view', options);
},
/**
* @param {JQueryMouseEventObject} e
* @this module:views/record/list.Class
*/
'auxclick a.link': function (e) {
let isCombination = e.button === 1 && (e.ctrlKey || e.metaKey);
if (!isCombination) {
return;
}
let $target = $(e.currentTarget);
let id = $target.attr('data-id');
if (!id) {
return;
}
let $quickView = $target.parent().closest(`[data-id="${id}"]`)
.find(`ul.list-row-dropdown-menu[data-id="${id}"] a[data-action="quickView"]`);
if (!$quickView.length) {
return;
}
e.preventDefault();
e.stopPropagation();
this.actionQuickView({id: id});
},
/**
* @this module:views/record/list.Class
*/