diff --git a/js/Close.jsx b/js/Close.jsx new file mode 100644 index 00000000..0ef471d4 --- /dev/null +++ b/js/Close.jsx @@ -0,0 +1,21 @@ +import React from 'react'; +import {connect} from 'react-redux'; + + +class Close extends React.Component { + constructor(props) { + super(props); + this.handleClick = this.handleClick.bind(this); + } + handleClick() { + this.props.dispatch({type: 'CLOSE'}); + } + render() { + return
; + } +} + +module.exports = connect()(Close); diff --git a/js/main-window-dom.js b/js/main-window-dom.js index 107caa43..d8d581c3 100644 --- a/js/main-window-dom.js +++ b/js/main-window-dom.js @@ -28,7 +28,7 @@ module.exports = el('div', {id: 'main-window', class: 'loading stop'}, [ el('div', {id: 'shade-time-holder'}), el('div', {id: 'minimize'}), el('div', {id: 'shade'}), - el('div', {id: 'close'}) + el('div', {id: 'close-holder'}) ]), el('div', {class: 'status'}, [ el('div', {id: 'clutter-bar'}, [ diff --git a/js/main-window.js b/js/main-window.js index c1659bcf..2fd00c55 100644 --- a/js/main-window.js +++ b/js/main-window.js @@ -12,6 +12,7 @@ import MonoStereo from './MonoStereo.jsx'; import Repeat from './Repeat.jsx'; import Shuffle from './Shuffle.jsx'; import Eject from './Eject.jsx'; +import Close from './Close.jsx'; import '../css/main-window.css'; @@ -19,7 +20,6 @@ module.exports = { init: function(winamp) { this.winamp = winamp; this.nodes = { - close: document.getElementById('close'), shade: document.getElementById('shade'), buttonD: document.getElementById('button-d'), visualizer: document.getElementById('visualizer'), @@ -43,6 +43,7 @@ module.exports = { this.winamp.renderTo(