Commit 9c08ce63 authored by Robert Schilling's avatar Robert Schilling

Merge pull request #7797 from cirosantilli/zen-style

Improve zen mode internals.
parents c759b8c9 04ef3ddc
class @ZenMode class @ZenMode
@fullscreen_prefix = 'fullscreen_' @fullscreen_prefix = 'fullscreen_'
@ESC = 27
constructor: -> constructor: ->
@active_zen_area = null @active_zen_area = null
@active_checkbox = null @active_checkbox = null
$('body').on 'change', '.zennable input[type=checkbox]', (e) => $('body').on 'change', '.zennable input[type=checkbox]', (e) =>
checkbox = e.currentTarget; checkbox = e.currentTarget
if checkbox.checked if checkbox.checked
Mousetrap.pause() Mousetrap.pause()
@udpateActiveZenArea(checkbox) @udpateActiveZenArea(checkbox)
...@@ -15,8 +14,7 @@ class @ZenMode ...@@ -15,8 +14,7 @@ class @ZenMode
@exitZenMode() @exitZenMode()
$(document).on 'keydown', (e) => $(document).on 'keydown', (e) =>
console.log("esc") if e.keyCode is $.ui.keyCode.ESCAPE
if e.keyCode is ZenMode.ESC
@exitZenMode() @exitZenMode()
$(window).on 'hashchange', @updateZenModeFromLocationHash $(window).on 'hashchange', @updateZenModeFromLocationHash
......
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