mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
JavaScript MVC: remove BaseModel because it is not used.
This commit is contained in:
@@ -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 || {};
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user