var FooterView = View.extend({ el: "#footer", events: { "click .ok": "ok", "click .cancel": "cancel", }, initialize: function(){ this.$ok = this.$(".ok") this.$cancel = this.$(".cancel") }, show: function(ok, cancel){ if (cancel) { this.$ok.removeClass("wide") this.$cancel.show().html(cancel) } else { this.$ok.addClass("wide") this.$cancel.hide() } this.$ok.html(ok) this.$el.show() }, hide: function(){ this.$el.hide() }, ok: function(){ (app.view.save || app.view.ok).bind(app.view)() }, cancel: function(){ app.view.cancel ? app.view.cancel() : app.intro.show() }, })