ctrl+click quick view
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user