mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-07 18:44:29 -04:00
Fixed #418, no more print/save dialogues evaaarr.
This commit is contained in:
parent
ddf0636e7e
commit
670f94cc22
3 changed files with 7 additions and 2 deletions
app
|
@ -5,10 +5,12 @@ locale = require 'locale/locale'
|
|||
Tracker = require 'lib/Tracker'
|
||||
CocoView = require 'views/kinds/CocoView'
|
||||
|
||||
# Prevent Ctrl/Cmd + [ / ], P, S
|
||||
ctrlDefaultPrevented = [219, 221, 80, 83]
|
||||
preventBackspace = (event) ->
|
||||
if event.keyCode is 8 and not elementAcceptsKeystrokes(event.srcElement or event.target)
|
||||
event.preventDefault()
|
||||
else if (key.ctrl or key.command) and not key.alt and event.keyCode in [219, 221] # prevent Ctrl/Cmd + [ / ]
|
||||
else if (key.ctrl or key.command) and not key.alt and event.keyCode in ctrlDefaultPrevented
|
||||
event.preventDefault()
|
||||
|
||||
elementAcceptsKeystrokes = (el) ->
|
||||
|
|
|
@ -21,6 +21,10 @@ module.exports = class ColorsTabView extends CocoView
|
|||
@interval = setInterval f, 1000
|
||||
super options
|
||||
|
||||
destroy: ->
|
||||
clearInterval @interval
|
||||
super()
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
@createShapeButtons()
|
||||
|
|
|
@ -44,7 +44,6 @@ module.exports = class PlaybackView extends View
|
|||
'⌘+[, ctrl+[': 'onScrubBack'
|
||||
'⌘+], ctrl+]': 'onScrubForward'
|
||||
|
||||
|
||||
# popover that shows at the current mouse position on the progressbar, using the bootstrap popover.
|
||||
# Could make this into a jQuery plugins itself theoretically.
|
||||
class HoverPopup extends $.fn.popover.Constructor
|
||||
|
|
Loading…
Add table
Reference in a new issue