Merge pull request #149 from cyraki/main
Minor UX Improvements: Context Menu Position and Album Hitbox
This commit is contained in:
commit
98c1a05aee
2 changed files with 3 additions and 4 deletions
|
@ -2,8 +2,7 @@
|
||||||
<div tabindex="0"
|
<div tabindex="0"
|
||||||
class="cd-mediaitem-square" :class="getClasses()" @contextmenu="contextMenu"
|
class="cd-mediaitem-square" :class="getClasses()" @contextmenu="contextMenu"
|
||||||
v-observe-visibility="{callback: visibilityChanged}"
|
v-observe-visibility="{callback: visibilityChanged}"
|
||||||
:style="{'--spcolor': getBgColor()}"
|
:style="{'--spcolor': getBgColor()}">
|
||||||
@click.self='app.routeView(item)'>
|
|
||||||
<template v-if="isVisible">
|
<template v-if="isVisible">
|
||||||
<div class="artwork-container">
|
<div class="artwork-container">
|
||||||
<div class="artwork" @click='app.routeView(item)'>
|
<div class="artwork" @click='app.routeView(item)'>
|
||||||
|
|
|
@ -72,10 +72,10 @@
|
||||||
style["top"] = this.event.clientY + "px";
|
style["top"] = this.event.clientY + "px";
|
||||||
// make sure the menu panel isnt off the screen
|
// make sure the menu panel isnt off the screen
|
||||||
if (this.event.clientX + this.size[0] > window.innerWidth) {
|
if (this.event.clientX + this.size[0] > window.innerWidth) {
|
||||||
style["left"] = (window.innerWidth - this.size[0]) + "px";
|
style["left"] = (this.event.clientX - this.size[0]) + "px";
|
||||||
}
|
}
|
||||||
if (this.event.clientY + this.size[1] > window.innerHeight) {
|
if (this.event.clientY + this.size[1] > window.innerHeight) {
|
||||||
style["top"] = (window.innerHeight - this.size[1]) + "px";
|
style["top"] = (this.event.clientY - this.size[1]) + "px";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return style
|
return style
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue