mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Change the document title according to the title of the main frame.
This commit is contained in:
parent
ea6357c259
commit
fa5f5bce28
3 changed files with 32 additions and 17 deletions
12
assets/controllers/turbo/title_controller.js
Normal file
12
assets/controllers/turbo/title_controller.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
//If we encounter an element with this, then change the title of our document according to data-title
|
||||
this.changeTitle(this.element.dataset.title);
|
||||
}
|
||||
|
||||
changeTitle(title) {
|
||||
document.title = title;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue