Commit 0d753e47 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '34627-remove-iifes' into 'master'

zen_mode.js: remove IIFEs. Closes #34627

Closes #34627

See merge request gitlab-org/gitlab!19282
parents 8725f0ed 74a717ab
/* eslint-disable func-names, consistent-return, camelcase, class-methods-use-this */ /* eslint-disable consistent-return, camelcase, class-methods-use-this */
// Zen Mode (full screen) textarea // Zen Mode (full screen) textarea
// //
...@@ -47,26 +47,16 @@ export default class ZenMode { ...@@ -47,26 +47,16 @@ export default class ZenMode {
e.preventDefault(); e.preventDefault();
return $(e.currentTarget).trigger('zen_mode:leave'); return $(e.currentTarget).trigger('zen_mode:leave');
}); });
$(document).on( $(document).on('zen_mode:enter', e => {
'zen_mode:enter', this.enter(
(function(_this) { $(e.target)
return function(e) { .closest('.md-area')
return _this.enter( .find('.zen-backdrop'),
$(e.target) );
.closest('.md-area') });
.find('.zen-backdrop'), $(document).on('zen_mode:leave', () => {
); this.exit();
}; });
})(this),
);
$(document).on(
'zen_mode:leave',
(function(_this) {
return function() {
return _this.exit();
};
})(this),
);
$(document).on('keydown', e => { $(document).on('keydown', e => {
// Esc // Esc
if (e.keyCode === 27) { if (e.keyCode === 27) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment