mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move beep method to rootView
This commit is contained in:
@@ -304,16 +304,7 @@ class Atom
|
||||
process.crash()
|
||||
|
||||
beep: ->
|
||||
@audioBeep() if @config.get('core.audioBeep')
|
||||
@visualBeep() if @config.get('core.visualBeep')
|
||||
|
||||
audioBeep: ->
|
||||
shell.beep()
|
||||
|
||||
visualBeep: ->
|
||||
overlay = $$ -> @div class: 'visual-beep'
|
||||
$('body').append overlay
|
||||
setTimeout((-> overlay.remove()), 300)
|
||||
@rootView.beep()
|
||||
|
||||
requireUserInitScript: ->
|
||||
userInitScriptPath = path.join(@config.configDirPath, "user.coffee")
|
||||
|
||||
@@ -2,6 +2,7 @@ fs = require 'fs'
|
||||
ipc = require 'ipc'
|
||||
path = require 'path'
|
||||
Q = require 'q'
|
||||
shell = require 'shell'
|
||||
{$, $$, View} = require './space-pen-extensions'
|
||||
fsUtils = require './fs-utils'
|
||||
_ = require 'underscore-plus'
|
||||
@@ -51,7 +52,6 @@ class RootView extends View
|
||||
themes: ['atom-dark-ui', 'atom-dark-syntax']
|
||||
projectHome: path.join(atom.getHomeDirPath(), 'github')
|
||||
audioBeep: true
|
||||
visualBeep: false
|
||||
|
||||
@acceptsDocuments: true
|
||||
|
||||
@@ -224,6 +224,11 @@ class RootView extends View
|
||||
else
|
||||
@setTitle('untitled')
|
||||
|
||||
# Public: Trigger alert sound and `beep` event
|
||||
beep: ->
|
||||
shell.beep() if config.get('core.audioBeep')
|
||||
@trigger 'beep'
|
||||
|
||||
# Public: Sets the application's title.
|
||||
setTitle: (title) ->
|
||||
document.title = title
|
||||
|
||||
@@ -61,23 +61,6 @@ div > .inline-block-tight:last-child {
|
||||
}
|
||||
}
|
||||
|
||||
.visual-beep {
|
||||
z-index: 1000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
opacity: 0.0;
|
||||
-webkit-animation: visual-beep-flash 0.2s ease-out;
|
||||
background: @background-color-warning;
|
||||
}
|
||||
|
||||
@-webkit-keyframes visual-beep-flash {
|
||||
0% { opacity: 0.5 }
|
||||
100% {opacity: 0.0 }
|
||||
}
|
||||
|
||||
.error {
|
||||
-webkit-animation: flash-error 0.3s ease-in;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user