/**
 * Created by Benny on 12.10.2014.
 */
"use strict";

var TB = TB || {};

TB.Page = function( id ) {
    this.id = id;
    this.$container = $( '#content' );
};
TB.Page.prototype.onEnter = function( params ) {
    this.create && this.create( params );
};
TB.Page.prototype.onLeave = function() {
    this.destroy && this.destroy();
};
TB.Page.prototype.create = function( params ) {
    this.$container.html( tmpl( 'tpl_' + this.id, { data: params } ) );
};
TB.Page.prototype.destroy = function() {
    this.$container.unbind();
    this.$container.html( "" );
};