JavaScript MVC: remove BaseModel because it is not used.

This commit is contained in:
Jeremy Goecks
2013-12-16 15:35:51 -05:00
parent 51b6811867
commit aec8d257c9
3 changed files with 3 additions and 27 deletions
+2 -25
View File
@@ -1,26 +1,3 @@
/**
* Simple base model for any visible element. Includes useful attributes and ability
* to set and track visibility.
*/
var BaseModel = Backbone.Model.extend({
defaults: {
name: null,
hidden: false
},
show: function() {
this.set("hidden", false);
},
hide: function() {
this.set("hidden", true);
},
is_visible: function() {
return !this.attributes.hidden;
}
});
/**
* Base view that handles visibility based on model's hidden attribute.
*/
@@ -52,10 +29,10 @@ var BaseView = Backbone.View.extend({
*
* @example
* // Add to your models/views at the definition using chaining:
* var MyModel = BaseModel.extend( LoggableMixin ).extend({ // ... });
* var MyModel = Backbone.Model.extend( LoggableMixin ).extend({ // ... });
*
* // or - more explicitly AFTER the definition:
* var MyModel = BaseModel.extend({
* var MyModel = Backbone.Model.extend({
* logger : console
* // ...
* this.log( '$#%& it! - broken already...' );
@@ -57,7 +57,6 @@ var History = Backbone.Model.extend( LoggableMixin ).extend(
* @param {Object} historyJSON model data for this History
* @param {Object[]} hdaJSON array of model data for this History's HDAs
* @param {Object} options any extra settings including logger
* @see BaseModel#initialize
*/
initialize : function( historyJSON, hdaJSON, options ){
options = options || {};
+1 -1
View File
@@ -67,7 +67,7 @@ var User = Backbone.Model.extend( LoggableMixin ).extend(
if( idOrCurrent === User.CURRENT_ID_STR ){
options.url = this.urlRoot + '/' + User.CURRENT_ID_STR;
}
return BaseModel.prototype.fetch.call( this, options );
return Backbone.Model.prototype.fetch.call( this, options );
},
/** Clears all data from the sessionStorage.