mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-15 08:48:42 +00:00
enable middle mouse on data-href
This commit is contained in:
parent
3d0fbc5778
commit
062267fb32
|
|
@ -66,14 +66,18 @@ export class GeneralUI
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
e[i].addEventListener('click', function(event) {
|
e[i].addEventListener('mouseup', function(event) {
|
||||||
|
if (event.button !== 0 && event.button !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jsOMS.preventAll(event);
|
jsOMS.preventAll(event);
|
||||||
history.pushState(null, null, window.location);
|
history.pushState(null, null, window.location);
|
||||||
|
|
||||||
let uri = this.getAttribute('data-href');
|
let uri = this.getAttribute('data-href');
|
||||||
uri = uri === null ? this.getAttribute('href') : uri;
|
uri = uri === null ? this.getAttribute('href') : uri;
|
||||||
|
|
||||||
if (this.getAttribute('target') === '_blank' || this.getAttribute(['data-target']) === '_blank') {
|
if (this.getAttribute('target') === '_blank' || this.getAttribute(['data-target']) === '_blank' || event.button === 1) {
|
||||||
window.open(UriFactory.build(uri), '_blank');
|
window.open(UriFactory.build(uri), '_blank');
|
||||||
} else {
|
} else {
|
||||||
window.location = UriFactory.build(uri);
|
window.location = UriFactory.build(uri);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user