diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-14 13:57:42 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-14 13:57:42 -0400 |
| commit | 410607684c7273a61f937635b41397208e245473 (patch) | |
| tree | 3e42d25d117658a7beb5175d24894cb827605cd2 /public/assets/javascripts/ui/lib/View.js | |
| parent | 0f649f2cfb034ad8458f08c8f23a2251135af059 (diff) | |
autosave
Diffstat (limited to 'public/assets/javascripts/ui/lib/View.js')
| -rw-r--r-- | public/assets/javascripts/ui/lib/View.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/public/assets/javascripts/ui/lib/View.js b/public/assets/javascripts/ui/lib/View.js index 999a0e5..d94e6db 100644 --- a/public/assets/javascripts/ui/lib/View.js +++ b/public/assets/javascripts/ui/lib/View.js @@ -1,13 +1,14 @@ var View = (function($, _){ var View = function(options) { - this.cid = _.uniqueId('view'); + this._id = _.uniqueId('view') + this.type = "view" options || (options = {}); - _.extend(this, _.pick(options, viewOptions)); - this._ensureElement(); - this.initialize.apply(this, arguments); - this.delegateEvents(); - }; + _.extend(this, _.pick(options, viewOptions)) + this._ensureElement() + this.initialize.apply(this, arguments) + this.delegateEvents() + } var delegateEventSplitter = /^(\S+)\s*(.*)$/; @@ -58,7 +59,7 @@ var View = (function($, _){ var match = key.match(delegateEventSplitter); var eventName = match[1], selector = match[2]; method = _.bind(method, this); - eventName += '.delegateEvents' + this.cid; + eventName += '.delegateEvents' + this._id; if (selector === '') { this.$el.on(eventName, method); } else { @@ -70,7 +71,7 @@ var View = (function($, _){ // Clears all callbacks previously bound to the view with `delegateEvents`. undelegateEvents: function() { - this.$el.off('.delegateEvents' + this.cid); + this.$el.off('.delegateEvents' + this._id); return this; }, |
