Skip to content
Snippets Groups Projects
Commit 26d81ff8 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

small changes

parent 8a2c6d68
Branches
No related tags found
No related merge requests found
...@@ -33,8 +33,12 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){ ...@@ -33,8 +33,12 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
onClose: function(){ onClose: function(){
var self = this; var self = this;
setTimeout(function(){ setTimeout(function(){
if (self.popup.closed) self.popup = null; if (self.popup.closed) self.dumpPopup();
}, 100);//todo this is stupid, find an event that fires with window.closed == true }, 100);//todo this is stupid, find an event that fires with window.closed == true
},
dumpPopup: function(){
this.popup = null;
} }
}); });
......
...@@ -23,6 +23,7 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni ...@@ -23,6 +23,7 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
_.bindAll(this, "_onKeyUp"); _.bindAll(this, "_onKeyUp");
$(document).bind('keyup', {}, this._onKeyUp); $(document).bind('keyup', {}, this._onKeyUp);
this.listenTo(serialComm, "change:lastMessageSent", this._updateOutgoingMessage); this.listenTo(serialComm, "change:lastMessageSent", this._updateOutgoingMessage);
this.listenTo(serialComm, "change:baudRate change:portName", this.render); this.listenTo(serialComm, "change:baudRate change:portName", this.render);
this.listenTo(serialComm, "change:connected", function(){ this.listenTo(serialComm, "change:connected", function(){
...@@ -38,6 +39,9 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni ...@@ -38,6 +39,9 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
if (e.keyCode == 38) $output.val(this.model.getPrevHistElem()); if (e.keyCode == 38) $output.val(this.model.getPrevHistElem());
else if (e.keyCode == 40) $output.val(this.model.getNewerHistElem()); else if (e.keyCode == 40) $output.val(this.model.getNewerHistElem());
else if (e.keyCode == 13) this._sendMessage(e); else if (e.keyCode == 13) this._sendMessage(e);
} else {
} }
}, },
...@@ -101,6 +105,7 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni ...@@ -101,6 +105,7 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
}, },
_close: function(){ _close: function(){
this.userInitedReload = false;
window.close(); window.close();
}, },
......
...@@ -39,6 +39,7 @@ require.config({ ...@@ -39,6 +39,7 @@ require.config({
require(['serialMonitorView', 'serialMonitor', 'positionControlPanelView', 'serialComm'], require(['serialMonitorView', 'serialMonitor', 'positionControlPanelView', 'serialComm'],
function(SerialMonitorView, serialMonitor, PositionControlPanelView, serialComm){ function(SerialMonitorView, serialMonitor, PositionControlPanelView, serialComm){
new SerialMonitorView({model: serialMonitor}); new SerialMonitorView({model: serialMonitor});
new PositionControlPanelView({model:serialComm}); new PositionControlPanelView({model:serialComm});
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment