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

@@ -16,6 +16,7 @@ define([
"apps/admin/fields/views/alert"
], function ($, _, Backbone, i18n, bootstrap, AlertView) {
var SaveView = Backbone.View.extend({
template: _.template($("#save_template").html()),
initialize: function () {
var self = this;
this.previousAttributes = [];
@@ -78,8 +79,7 @@ define([
return this;
},
render: function () {
var template = _.template($("#save_template").html());
this.$el.html(template);
this.$el.html(this.template());
this.updateStateButton();
return this;