mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
21 lines
No EOL
623 B
JavaScript
21 lines
No EOL
623 B
JavaScript
import {Controller} from "@hotwired/stimulus";
|
|
import {Popover} from "bootstrap";
|
|
|
|
export default class extends Controller {
|
|
connect() {
|
|
const thumbnail_url = this.element.dataset.thumbnail;
|
|
|
|
this._popover = Popover.getOrCreateInstance(this.element, {
|
|
html: true,
|
|
trigger: 'hover',
|
|
placement: 'right',
|
|
container: 'body',
|
|
'title': this.element.dataset.title ?? '',
|
|
content: function () {
|
|
return '<img class="img-fluid" src="' + thumbnail_url + '" />';
|
|
}
|
|
});
|
|
|
|
this._popover.hide();
|
|
}
|
|
} |