mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
20 lines
568 B
JavaScript
20 lines
568 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',
|
||
|
content: function () {
|
||
|
return '<img class="img-fluid" src="' + thumbnail_url + '" />';
|
||
|
}
|
||
|
});
|
||
|
|
||
|
this._popover.hide();
|
||
|
}
|
||
|
}
|