Added close button functionality
This commit is contained in:
parent
12cbdbdfd8
commit
37d84a724c
2 changed files with 11 additions and 2 deletions
|
@ -1,14 +1,19 @@
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
|
var ipc = window.require('ipc');
|
||||||
|
|
||||||
var NavBar = React.createClass({
|
var NavBar = React.createClass({
|
||||||
|
handleClose: function (evt) {
|
||||||
|
ipc.send('close');
|
||||||
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
return (
|
return (
|
||||||
<nav id="navbar" className="navbar navbar-default navbar-fixed-top">
|
<nav id="navbar" className="navbar navbar-default navbar-fixed-top">
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<a className="navbar-brand">Keyboard Mechanizer</a>
|
<a className="navbar-brand">Keyboard Mechanizer</a>
|
||||||
<ul className="nav navbar-nav navbar-right">
|
<ul className="nav navbar-nav navbar-right">
|
||||||
<li><a href="#">Hide</a></li>
|
<li><a href="#" className="no-drag">Hide</a></li>
|
||||||
<li><a href="#"><i className="icon ion-close-round"></i></a></li>
|
<li><a href="#" onClick={this.handleClose}className="no-drag"><i className="icon ion-close-round"></i></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -40,4 +40,8 @@ ipc.on('hide', function () {
|
||||||
|
|
||||||
ipc.on('show', function () {
|
ipc.on('show', function () {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipc.on('close', function () {
|
||||||
|
mainWindow.close();
|
||||||
});
|
});
|
Reference in a new issue