summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/nav/FooterView.js
blob: 74b249e698a02e574eea49d49351438abdaaa462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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()
  },
  
})