Commit 5c2acc51 authored by Robert Schilling's avatar Robert Schilling

Merge branch 'fix-escape-key-in-zen-mode' into 'master'

Fix Zen Mode not closing with ESC key

### What does this MR do?

This MR fixes the ESC key not leaving Zen Mode (fullscreen).

### Why was this MR needed?

This has been broken since GitLab v7.8. The `change` event for `zen-toggle-comment` was never fired. See:

http://stackoverflow.com/questions/19505011/checkbox-checked-with-prop-does-not-fire-events-attached-to-change?answertab=votes#tab-top

### What are the relevant issue numbers?

* Closes #1025
* Closes https://github.com/gitlabhq/gitlabhq/issues/9018

See merge request !710
parents f815094e 710627fb
......@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.12.0 (unreleased)
- Refactor permission checks with issues and merge requests project settings (Stan Hu)
- Fix Markdown preview not working in Edit Milestone page (Stan Hu)
- Fix Zen Mode not closing with ESC key (Stan Hu)
- Add web hook support for note events (Stan Hu)
- Disable "New Issue" and "New Merge Request" buttons when features are disabled in project settings (Stan Hu)
- Remove Rack Attack monkey patches and bump to version 4.3.0 (Stan Hu)
......
......@@ -10,11 +10,11 @@ class @ZenMode
$('body').on 'click', '.zen-enter-link', (e) =>
e.preventDefault()
$(e.currentTarget).closest('.zennable').find('.zen-toggle-comment').prop('checked', true)
$(e.currentTarget).closest('.zennable').find('.zen-toggle-comment').prop('checked', true).change()
$('body').on 'click', '.zen-leave-link', (e) =>
e.preventDefault()
$(e.currentTarget).closest('.zennable').find('.zen-toggle-comment').prop('checked', false)
$(e.currentTarget).closest('.zennable').find('.zen-toggle-comment').prop('checked', false).change()
$('body').on 'change', '.zen-toggle-comment', (e) =>
checkbox = e.currentTarget
......
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