Commit ac59d35a authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

autoscroll

parent 68f85ece
......@@ -63,11 +63,17 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
},
__sendMessage: function(message){
$("#serialMonitorOutput").append("<span class='outgoing'>" + message + "</span><br/>");
this._addOutputData("<span class='outgoing'>" + message + "</span><br/>");
},
_updateIncomingMessage: function(){
$("#serialMonitorOutput").append("<span class='incoming'>" + serialComm.get("lastMessageReceived") + "</span><br/>");
this._addOutputData("<span class='incoming'>" + serialComm.get("lastMessageReceived") + "</span><br/>");
},
_addOutputData: function(html){
var $output = $("#serialMonitorOutput");
$output.append(html);
if (this.model.get("autoscroll")) $output.animate({scrollTop:$output.scrollTop()+$output.innerHeight()}, "fast");
},
template: _.template(template)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment