mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
528c8850ce
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`
31 lines
832 B
CoffeeScript
31 lines
832 B
CoffeeScript
{Utils, DraftStore, React} = require 'nylas-exports'
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class CalendarButton extends React.Component
|
|
@displayName: 'CalendarButton'
|
|
|
|
render: =>
|
|
React.createElement("div", {"className": "btn btn-toolbar", "onClick": (@_onClick)}, """
|
|
Add Availability
|
|
""")
|
|
|
|
_onClick: =>
|
|
BrowserWindow = require('remote').require('browser-window')
|
|
w = new BrowserWindow
|
|
nodeIntegration: false
|
|
webPreferences:
|
|
webSecurity:false
|
|
width: 700
|
|
height: 600
|
|
|
|
# Here, we load an arbitrary html file into the Composer!
|
|
path = require 'path'
|
|
url = path.join __dirname, '..', 'calendar.html'
|
|
w.loadURL "file://#{url}?draftClientId=#{@props.draftClientId}"
|
|
|
|
|
|
_getDialog: =>
|
|
require('remote').require('dialog')
|
|
|
|
|
|
module.exports = CalendarButton
|