(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; if (ELA.Views == null) { ELA.Views = {}; } ELA.Views.Headup = (function(superClass) { extend(Headup, superClass); function Headup() { this.render = bind(this.render, this); this.deactivate = bind(this.deactivate, this); this.activate = bind(this.activate, this); return Headup.__super__.constructor.apply(this, arguments); } Headup.prototype.activate = function(control) { this.subviews.control = control.clone(); this.$el.addClass('active'); return this.render(); }; Headup.prototype.deactivate = function() { this.$el.removeClass('active'); return this.subviews.control.remove(); }; Headup.prototype.render = function() { this.$el.html(this.subviews.control.render().el); return this; }; return Headup; })(Backbone.Poised.View); }).call(this);