aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/lib/page_layout.js
blob: 9509518f842e01f63c35195bac56a312586c9d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*jslint esversion: 6*/
let options = {
    title: document.title,
    prefix: ''
};

export default {
    get title () {
        return options.title;
    },

    set title (title) {
        options.title = title;
        this.displayTitle();
    },

    get title_prefix () {
        return options.prefix;
    },

    set title_prefix (prefix) {
        options.prefix = prefix;
        this.displayTitle();
    },

    displayTitle () {
        document.title = `${options.prefix}${options.title}`;
    }
};