export default class Browser {
    constructor(os) {
        this.os = os;
        this.element = document.getElementById('browser');
        this.closeBtn = this.element.querySelector('.close-btn');

        this.initialize();
    }

    initialize() {
        this.closeBtn.addEventListener('click', (e) => {
            e.stopPropagation();
            this.os.closeAllPopups();
        });
    }

    open() {
        this.element.classList.add('active');
        this.os.components.taskbar.updateActiveButton('browser');
    }

    close() {
        this.element.classList.remove('active');
        this.os.components.taskbar.updateActiveButton(null);
    }
}
