UI, Collections: correct foldout expansion for collections only re-rendering on 'populated' or 'visible' change; correct foldout expansion in published histories by giving dataset collection elements an api endpoint and moving 'rerunnable' and 'creating_job' fetch into li-edit

This commit is contained in:
carlfeberhard
2015-09-30 15:08:32 -04:00
parent b1a8aebad6
commit 2c45f356a9
12 changed files with 37 additions and 18 deletions
@@ -126,6 +126,14 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( BASE_MVC.mixin( Datase
/** logger used to record this.log messages, commonly set to console */
//logger : console,
/** root api url */
urlRoot : (( window.galaxy_config && galaxy_config.root )?( galaxy_config.root ):( '/' )) + 'api/datasets',
/** url fn */
url : function(){
return this.urlRoot + '/' + this.id;
},
defaults : _.extend( {},
DATASET_MODEL.DatasetAssociation.prototype.defaults,
DatasetCollectionElementMixin.defaults
@@ -109,6 +109,25 @@ var DatasetListItemEdit = _super.extend(
},
// ......................................................................... details
/** In this override, only get details if in the ready state, get rerunnable if in other states.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });
// special case the need for the rerunnable and creating_job attributes
// needed for rendering re-run button on queued, running datasets
} else if( !view.model.has( 'rerunnable' ) ){
return view.model.fetch({ silent: true, data: {
// only fetch rerunnable and creating_job to keep overhead down
keys: [ 'rerunnable', 'creating_job' ].join(',')
}});
}
return jQuery.when();
},
/** In this override, add tags and annotations controls, make the ? dbkey a link to editing page */
_renderDetails : function(){
//TODO: generalize to be allow different details for each state
@@ -65,14 +65,6 @@ var DatasetListItemView = _super.extend(
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });
// special case the need for the rerunnable and creating_job attributes
// needed for rendering re-run button on queued, running datasets
} else if( !view.model.has( 'rerunnable' ) ){
return view.model.fetch({ silent: true, data: {
// only fetch rerunnable and creating_job to keep overhead down
keys: [ 'rerunnable', 'creating_job' ].join(',')
}});
}
return jQuery.when();
},
+2 -2
View File
@@ -22,8 +22,8 @@ var HDCAListItemView = _super.extend(
_setUpListeners : function(){
_super.prototype._setUpListeners.call( this );
this.model.on( 'change', function( model, options ){
this.render();
this.model.on({
'change:populated change:visible' : function( model, options ){ this.render(); },
}, this );
},