UNPKG

wise-web-client

Version:

Based on Spine MVC framework

39 lines (29 loc) 1.1 kB
define(['jquery', 'backbone', 'handlebars', 'moment', './BaseView', 'text!../../../tpl/assignments_modal.hbr' ], function($, Backbone, Handlebars, moment, BaseView, template) { var View = BaseView.extend({ // The DOM Element associated with this view el: '#overlay-container', template: Handlebars.compile(template), // View Event Handlers events: { 'click button.close': 'close' }, // Renders the view's template to the UI render: function() { Handlebars.registerHelper('humanizeDuration', function(duration) { return moment.duration(duration).humanize(); }); this.$el.html(this.template(this.model)); // Maintains chainability return this; }, close: function() { $('.modal').modal('hide'); } }); // Returns the View class return View; } );