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

@@ -14,6 +14,7 @@ define([
"i18n"
], function ($, _, Backbone, i18n) {
var FieldErrorView = Backbone.View.extend({
template: _.template($("#field_error_template").html()),
initialize: function () {
AdminFieldApp.errorManager.on("add-error", this.render, this);
AdminFieldApp.errorManager.on("remove-error", this.render, this);
@@ -33,11 +34,7 @@ define([
});
});
var template = _.template($("#field_error_template").html(), {
messages: messages
});
$(".block-alert").html(template);
$(".block-alert").html(this.template({messages: messages}));
return this;
}