mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
UI, histories: correct allFetched setting in setCollection to allow fetching after changing collection order
This commit is contained in:
@@ -492,6 +492,8 @@ var HistoryCollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).ext
|
||||
this.setOrder( options.order || this.DEFAULT_ORDER );
|
||||
/** @type {String} encoded id of the history that's current */
|
||||
this.currentHistoryId = options.currentHistoryId;
|
||||
/** @type {boolean} have all histories been fetched and in the collection? */
|
||||
this.allFetched = options.allFetched || false;
|
||||
|
||||
// this.on( 'all', function(){
|
||||
// console.info( 'event:', arguments );
|
||||
@@ -580,8 +582,10 @@ var HistoryCollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).ext
|
||||
* and set allFetched/fire 'all-fetched' when xhr returns
|
||||
*/
|
||||
fetch : function( options ){
|
||||
console.debug( 'fetch', this.allFetched );
|
||||
options = options || {};
|
||||
if( this.allFetched ){ return jQuery.when({}); }
|
||||
console.debug( 'fetching' );
|
||||
var collection = this,
|
||||
fetchOptions = _.defaults( options, {
|
||||
remove : false,
|
||||
|
||||
@@ -439,7 +439,6 @@ var MultiPanelColumns = Backbone.View.extend( baseMVC.LoggableMixin ).extend({
|
||||
this.stopListening( this.collection );
|
||||
|
||||
this.collection = collection || new HISTORY_MODEL.HistoryCollection();
|
||||
this.collection.allFetched = !this.perPage || ( this.collection.length < this.perPage );
|
||||
this.setUpCollectionListeners();
|
||||
|
||||
this.collection.sort({ silent : true });
|
||||
@@ -454,7 +453,7 @@ var MultiPanelColumns = Backbone.View.extend( baseMVC.LoggableMixin ).extend({
|
||||
/** Set up a (new) history collection, sorting and adding listeners
|
||||
* @fires 'new-collection' when set with this view as the arg
|
||||
*/
|
||||
addModels : function setCollection( models, collection, options ){
|
||||
addModels : function addModels( models, collection, options ){
|
||||
options = options || {};
|
||||
var multipanel = this;
|
||||
models = _.isArray( models )? models : [ models ];
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user