0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 13:02:45 +00:00
This commit is contained in:
Scott Tolksdorf
2016-12-27 17:42:16 -05:00
parent f75f60aa1e
commit 41303e6918
7 changed files with 22 additions and 126 deletions

View File

@@ -23,16 +23,16 @@ const ContinousSave = React.createClass({
};
},
componentDidMount: function() {
flux.actionEmitter.on('dispatch', this.brewUpdate);
flux.actionEmitter.on('dispatch', this.actionHandler);
window.onbeforeunload = ()=>{
if(this.props.status !== 'ready') return 'You have unsaved changes!';
};
},
componentWillUnmount: function() {
flux.actionEmitter.removeListenr('dispatch', this.brewUpdate);
flux.actionEmitter.removeListener('dispatch', this.actionHandler);
window.onbeforeunload = function(){};
},
brewUpdate : function(actionType){
actionHandler : function(actionType){
if(actionType == 'UPDATE_BREW_TEXT' || actionType == 'UPDATE_META'){
Actions.pendingSave();
}

View File

@@ -99,14 +99,12 @@
text-align : center;
}
}
.staticSave.navItem{
background-color: @orange;
background-color : @orange;
&:hover{
background-color: @green;
background-color : @green;
}
}
.continousSave.navItem{
width : 105px;
text-align : center;