mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-03-16 22:20:23 +00:00
25 lines
No EOL
689 B
JavaScript
25 lines
No EOL
689 B
JavaScript
define( [
|
|
'jquery',
|
|
'views/managed-view',
|
|
'text!views/templates/wiretap.html',
|
|
'models/wiretap-model'
|
|
],
|
|
function ( $, ManagedView, template, WiretapModel ) {
|
|
"use strict";
|
|
|
|
return ManagedView.extend( {
|
|
el : "#wiretap",
|
|
|
|
initialize : function () {
|
|
ManagedView.prototype.initialize.call(this, template);
|
|
this.model = new WiretapModel();
|
|
this.model.bind( "add", this.render );
|
|
},
|
|
|
|
render : function () {
|
|
this.$el.html( this.template( { messages: this.model.toJSON() } ) );
|
|
// Yes, I know - quick, dirty and ugly :-)
|
|
this.$el.find(".scrollableDiv").animate({ scrollTop: this.$el.find(".scrollableDiv")[0].scrollHeight }, "fast");
|
|
}
|
|
} );
|
|
} ); |