Add CSS class indicating platform on body

This commit is contained in:
Matt Colyer
2013-11-14 10:48:45 -08:00
parent fe0cc7d273
commit 1ef821f4e7

View File

@@ -44,6 +44,7 @@ class Atom
initialize: ->
@unsubscribe()
@setBodyPlatformClass()
{devMode, resourcePath} = atom.getLoadSettings()
configDirPath = @getConfigDirPath()
@@ -68,6 +69,11 @@ class Atom
@pasteboard = new Pasteboard()
@syntax = deserialize(@getWindowState('syntax')) ? new Syntax()
# Private:
setBodyPlatformClass: ->
bodyEl = document.getElementsByTagName('body')[0]
bodyEl.classList.add("platform-#{process.platform}")
getCurrentWindow: ->
remote.getCurrentWindow()