summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib/View.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-08-14 13:57:42 -0400
committerJules Laplace <jules@okfoc.us>2014-08-14 13:57:42 -0400
commit410607684c7273a61f937635b41397208e245473 (patch)
tree3e42d25d117658a7beb5175d24894cb827605cd2 /public/assets/javascripts/ui/lib/View.js
parent0f649f2cfb034ad8458f08c8f23a2251135af059 (diff)
autosave
Diffstat (limited to 'public/assets/javascripts/ui/lib/View.js')
-rw-r--r--public/assets/javascripts/ui/lib/View.js17
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;
},