refactor ZenMode to ES module syntax
This commit is contained in:
parent
3b32313cce
commit
5d34237854
|
@ -4,7 +4,6 @@
|
||||||
/* global ShortcutsNavigation */
|
/* global ShortcutsNavigation */
|
||||||
/* global IssuableIndex */
|
/* global IssuableIndex */
|
||||||
/* global ShortcutsIssuable */
|
/* global ShortcutsIssuable */
|
||||||
/* global ZenMode */
|
|
||||||
/* global Milestone */
|
/* global Milestone */
|
||||||
/* global IssuableForm */
|
/* global IssuableForm */
|
||||||
/* global LabelsSelect */
|
/* global LabelsSelect */
|
||||||
|
@ -54,6 +53,7 @@ import UsersSelect from './users_select';
|
||||||
import RefSelectDropdown from './ref_select_dropdown';
|
import RefSelectDropdown from './ref_select_dropdown';
|
||||||
import GfmAutoComplete from './gfm_auto_complete';
|
import GfmAutoComplete from './gfm_auto_complete';
|
||||||
import ShortcutsBlob from './shortcuts_blob';
|
import ShortcutsBlob from './shortcuts_blob';
|
||||||
|
import ZenMode from './zen_mode';
|
||||||
import initSettingsPanels from './settings_panels';
|
import initSettingsPanels from './settings_panels';
|
||||||
import initExperimentalFlags from './experimental_flags';
|
import initExperimentalFlags from './experimental_flags';
|
||||||
import OAuthRememberMe from './oauth_remember_me';
|
import OAuthRememberMe from './oauth_remember_me';
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */
|
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */
|
||||||
/* global GitLab */
|
/* global GitLab */
|
||||||
/* global ZenMode */
|
|
||||||
/* global Autosave */
|
/* global Autosave */
|
||||||
/* global dateFormat */
|
/* global dateFormat */
|
||||||
/* global Pikaday */
|
/* global Pikaday */
|
||||||
|
|
||||||
import UsersSelect from './users_select';
|
import UsersSelect from './users_select';
|
||||||
import GfmAutoComplete from './gfm_auto_complete';
|
import GfmAutoComplete from './gfm_auto_complete';
|
||||||
|
import ZenMode from './zen_mode';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.IssuableForm = (function() {
|
this.IssuableForm = (function() {
|
||||||
|
|
|
@ -162,7 +162,6 @@ import './users_select';
|
||||||
import './version_check_image';
|
import './version_check_image';
|
||||||
import './visibility_select';
|
import './visibility_select';
|
||||||
import './wikis';
|
import './wikis';
|
||||||
import './zen_mode';
|
|
||||||
|
|
||||||
// eslint-disable-next-line global-require, import/no-commonjs
|
// eslint-disable-next-line global-require, import/no-commonjs
|
||||||
if (process.env.NODE_ENV !== 'production') require('./test_utils/');
|
if (process.env.NODE_ENV !== 'production') require('./test_utils/');
|
||||||
|
|
|
@ -35,7 +35,7 @@ window.Dropzone = Dropzone;
|
||||||
// **Target** a.js-zen-leave
|
// **Target** a.js-zen-leave
|
||||||
//
|
//
|
||||||
|
|
||||||
class ZenMode {
|
export default class ZenMode {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.active_backdrop = null;
|
this.active_backdrop = null;
|
||||||
this.active_textarea = null;
|
this.active_textarea = null;
|
||||||
|
@ -93,5 +93,3 @@ class ZenMode {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.ZenMode = ZenMode;
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/* eslint-disable space-before-function-paren, no-var, one-var, one-var-declaration-per-line, object-shorthand, comma-dangle, no-return-assign, new-cap, max-len */
|
/* eslint-disable space-before-function-paren, no-var, one-var, one-var-declaration-per-line, object-shorthand, comma-dangle, no-return-assign, new-cap, max-len */
|
||||||
/* global Dropzone */
|
/* global Dropzone */
|
||||||
/* global Mousetrap */
|
/* global Mousetrap */
|
||||||
/* global ZenMode */
|
|
||||||
|
|
||||||
import '~/zen_mode';
|
import ZenMode from '~/zen_mode';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var enterZen, escapeKeydown, exitZen;
|
var enterZen, escapeKeydown, exitZen;
|
||||||
|
|
Loading…
Reference in New Issue