mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 13:02:45 +00:00
'Share
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user