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

@@ -17,6 +17,7 @@ define([
var AlertView = Backbone.View.extend({
tagName: "div",
className: "alert",
template: _.template($("#alert_template").html()),
initialize: function (options) {
var self = this;
@@ -32,11 +33,8 @@ define([
},
render: function () {
var self = this;
var template = _.template($("#alert_template").html(), {
msg: this.message
});
this.$el.addClass("alert-" + this.alert).html(template).alert();
this.$el.addClass("alert-" + this.alert).html(this.template({msg: this.message})).alert();
if (this.delay > 0) {
window.setTimeout(function () {