Sha256: 1b92df8cae9187f796ae9b82b480e43327b0ca3f90ad9643bad88c9a7027e30e

Contents?: true

Size: 1.73 KB

Versions: 38

Compression:

Stored size: 1.73 KB

Contents

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { controller, target } from '@github/catalyst';
let ZenModeButtonElement = class ZenModeButtonElement extends HTMLElement {
    constructor() {
        super(...arguments);
        this.inZenMode = false;
    }
    deactivateZenMode() {
        this.inZenMode = false;
        this.button.setAttribute('aria-pressed', 'false');
        if (document.exitFullscreen) {
            void document.exitFullscreen();
        }
    }
    activateZenMode() {
        this.inZenMode = true;
        this.button.setAttribute('aria-pressed', 'true');
        if (document.documentElement.requestFullscreen) {
            void document.documentElement.requestFullscreen();
        }
    }
    performAction() {
        if (this.inZenMode) {
            this.deactivateZenMode();
        }
        else {
            this.activateZenMode();
        }
    }
};
__decorate([
    target
], ZenModeButtonElement.prototype, "button", void 0);
ZenModeButtonElement = __decorate([
    controller
], ZenModeButtonElement);
if (!window.customElements.get('zen-mode-button')) {
    window.ZenModeButtonElement = ZenModeButtonElement;
    window.customElements.define('zen-mode-button', ZenModeButtonElement);
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.48.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.47.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.47.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.46.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.46.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.45.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.44.3 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.44.2 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.44.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.44.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.43.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.43.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.42.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.41.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.41.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.40.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.39.1 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.39.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.38.0 app/components/primer/open_project/zen_mode_button.js
openproject-primer_view_components-0.37.1 app/components/primer/open_project/zen_mode_button.js