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
//
......@@ -47,26 +47,16 @@ export default class ZenMode {
e.preventDefault();
return $(e.currentTarget).trigger('zen_mode:leave');
});
$(document).on(
'zen_mode:enter',
(function(_this) {
return function(e) {
return _this.enter(
$(document).on('zen_mode:enter', e => {
this.enter(
$(e.target)
.closest('.md-area')
.find('.zen-backdrop'),
);
};
})(this),
);
$(document).on(
'zen_mode:leave',
(function(_this) {
return function() {
return _this.exit();
};
})(this),
);
});
$(document).on('zen_mode:leave', () => {
this.exit();
});
$(document).on('keydown', e => {
// Esc
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