mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 07:58:04 +03:00
Bind link click handler in window.handleEvents()
This commit is contained in:
parent
c2118a8cb9
commit
ee621bcace
@ -7,7 +7,7 @@ describe "Window", ->
|
||||
|
||||
beforeEach ->
|
||||
spyOn(atom, 'getPathToOpen').andReturn(project.getPath())
|
||||
window.handleWindowEvents()
|
||||
window.handleEvents()
|
||||
window.deserializeEditorWindow()
|
||||
projectPath = project.getPath()
|
||||
|
||||
|
@ -28,15 +28,6 @@ window.setUpEnvironment = ->
|
||||
window.keymap = new Keymap()
|
||||
$(document).on 'keydown', keymap.handleKeyEvent
|
||||
|
||||
$(document).on 'click', 'a', (e) ->
|
||||
location = $(e.target).attr('href')
|
||||
return unless location
|
||||
return if location[0] is '#'
|
||||
|
||||
if location.indexOf('https://') is 0 or location.indexOf('http://') is 0
|
||||
require('child_process').spawn('open', [location])
|
||||
false
|
||||
|
||||
keymap.bindDefaultKeys()
|
||||
|
||||
requireStylesheet 'atom'
|
||||
@ -53,7 +44,7 @@ window.startEditorWindow = ->
|
||||
console.warn "Failed to install `atom` binary"
|
||||
|
||||
atom.windowMode = 'editor'
|
||||
handleWindowEvents()
|
||||
handleEvents()
|
||||
handleDragDrop()
|
||||
config.load()
|
||||
keymap.loadBundledKeymaps()
|
||||
@ -68,7 +59,7 @@ window.startEditorWindow = ->
|
||||
|
||||
window.startConfigWindow = ->
|
||||
atom.windowMode = 'config'
|
||||
handleWindowEvents()
|
||||
handleEvents()
|
||||
config.load()
|
||||
keymap.loadBundledKeymaps()
|
||||
atom.loadThemes()
|
||||
@ -120,13 +111,22 @@ window.unloadConfigWindow = ->
|
||||
window.configView = null
|
||||
$(window).off('focus blur before')
|
||||
|
||||
window.handleWindowEvents = ->
|
||||
window.handleEvents = ->
|
||||
$(window).command 'window:toggle-full-screen', => atom.toggleFullScreen()
|
||||
$(window).on 'focus', -> $("body").removeClass('is-blurred')
|
||||
$(window).on 'blur', -> $("body").addClass('is-blurred')
|
||||
$(window).command 'window:close', => confirmClose()
|
||||
$(window).command 'window:reload', => reload()
|
||||
|
||||
$(document).on 'click', 'a', (e) ->
|
||||
location = $(e.target).attr('href')
|
||||
return unless location
|
||||
return if location[0] is '#'
|
||||
|
||||
if location.indexOf('https://') is 0 or location.indexOf('http://') is 0
|
||||
require('child_process').spawn('open', [location])
|
||||
false
|
||||
|
||||
window.handleDragDrop = ->
|
||||
$(document).on 'dragover', (e) ->
|
||||
e.preventDefault()
|
||||
|
Loading…
Reference in New Issue
Block a user