Commit a224963e authored by petitminion's avatar petitminion
Browse files

fix eslinter

parent eaa15d60
Pipeline #16942 failed with stages
in 11 minutes and 4 seconds
......@@ -55,7 +55,6 @@
</template>
<script>
import axios from 'axios'
import jQuery from 'jquery'
import ReportMixin from '@/components/mixins/Report'
......@@ -65,23 +64,23 @@ export default {
mixins: [ReportMixin, PlayOptionsMixin],
props: {
// we can either have a single or multiple tracks to play when clicked
tracks: {type: Array, required: false},
track: {type: Object, required: false},
account: {type: Object, required: false},
dropdownIconClasses: {type: Array, required: false, default: () => { return ['dropdown'] }},
playIconClass: {type: String, required: false, default: 'play icon'},
buttonClasses: {type: Array, required: false, default: () => { return ['button'] }},
playlist: {type: Object, required: false},
discrete: {type: Boolean, default: false},
dropdownOnly: {type: Boolean, default: false},
iconOnly: {type: Boolean, default: false},
artist: {type: Object, required: false},
album: {type: Object, required: false},
library: {type: Object, required: false},
channel: {type: Object, required: false},
isPlayable: {type: Boolean, required: false, default: null},
playing: {type: Boolean, required: false, default: false},
paused: {type: Boolean, required: false, default: false}
tracks: { type: Array, required: false },
track: { type: Object, required: false },
account: { type: Object, required: false },
dropdownIconClasses: { type: Array, required: false, default: () => { return ['dropdown'] } },
playIconClass: { type: String, required: false, default: 'play icon'},
buttonClasses: { type: Array, required: false, default: () => { return ['button'] } },
playlist: { type: Object, required: false },
discrete: { type: Boolean, default: false },
dropdownOnly: { type: Boolean, default: false },
iconOnly: { type: Boolean, default: false },
artist: { type: Object, required: false },
album: { type: Object, required: false },
library: { type: Object, required: false },
channel: { type: Object, required: false },
isPlayable: { type: Boolean, required: false, default: null },
playing: { type: Boolean, required: false, default: false },
paused: { type: Boolean, required: false, default: false }
},
data () {
return {
......@@ -111,7 +110,7 @@ export default {
startRadio: this.$pgettext('*/Queue/Dropdown/Button/Title', 'Play similar songs'),
report: this.$pgettext('*/Moderation/*/Button/Label,Verb', 'Report…'),
addToPlaylist: this.$pgettext('Sidebar/Player/Icon.Tooltip/Verb', 'Add to playlist…'),
replacePlay,
replacePlay
}
},
title () {
......@@ -122,7 +121,7 @@ export default {
return this.$pgettext('*/Queue/Button/Title', 'This track is not available in any library you have access to')
}
}
},
}
},
watch: {
clicked () {
......@@ -140,25 +139,25 @@ export default {
button.click()
}
jQuery(self.$el).find('.ui.dropdown').dropdown('hide')
},
}
})
jQuery(this.$el).find('.ui.dropdown').dropdown('show', function () {
// little magic to ensure the menu is always visible in the viewport
// By default, try to diplay it on the right if there is enough room
let menu = jQuery(self.$el).find('.ui.dropdown').find(".menu")
let viewportOffset = menu.get(0).getBoundingClientRect();
let left = viewportOffset.left;
let menu = jQuery(self.$el).find('.ui.dropdown').find('.menu')
let viewportOffset = menu.get(0).getBoundingClientRect()
let left = viewportOffset.left
let viewportWidth = document.documentElement.clientWidth
let rightOverflow = viewportOffset.right - viewportWidth
let leftOverflow = -viewportOffset.left
let offset = 0
if (rightOverflow > 0) {
offset = -rightOverflow - 5
menu.css({cssText: `left: ${offset}px !important;`});
menu.css({ cssText: `left: ${offset}px !important;` })
}
else if (leftOverflow > 0) {
offset = leftOverflow + 5
menu.css({cssText: `right: -${offset}px !important;`});
offset = leftOverflow + 5
menu.css({ cssText: `right: -${offset}px !important;` });
}
})
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment