refactored code to use newer version of backbone.js and underscore.js

This commit is contained in:
Mike Ng
2018-02-05 16:14:13 +04:00
parent df85aa8827
commit 1337a6994f
11 changed files with 37 additions and 45 deletions

View File

@@ -13,8 +13,8 @@ define([
"backbone"
], function ($, _, Backbone) {
var SchedulerView = Backbone.View.extend({
template: _.template($('#scheduler_template').html()),
initialize: function () {
this.template = _.template($('#scheduler_template').html());
// render only parts of the model
this.model.on('change:configuration', this.renderConfiguration, this);
this.model.on('change:actual', this.renderActual, this);

View File

@@ -13,8 +13,8 @@ define([
"backbone"
], function ($, _, Backbone) {
var TaskView = Backbone.View.extend({
template: _.template($('#task_template').html()),
initialize: function () {
this.template = _.template($('#task_template').html());
// render only parts of the model
this.model.on('change:id', this.renderId, this);
this.model.on('change:configuration', this.renderConfiguration, this);