mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
(a) Fetch sample names before drawing variant track and (b) update dataset metadata when changed.
This commit is contained in:
@@ -20,8 +20,15 @@ var Dataset = Backbone.RelationalModel.extend({
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
// -- Create and initialize metadata. --
|
||||
// Set metadata.
|
||||
// FIXME: pass back a metadata dict and then Backbone-relational
|
||||
// can be used unpack metadata automatically.
|
||||
this._set_metadata();
|
||||
// Update metadata on change.
|
||||
this.on('change', this._set_metadata, this);
|
||||
},
|
||||
|
||||
_set_metadata: function() {
|
||||
var metadata = new DatasetMetadata();
|
||||
|
||||
// Move metadata from dataset attributes to metadata object.
|
||||
@@ -34,7 +41,8 @@ var Dataset = Backbone.RelationalModel.extend({
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.set('metadata', metadata);
|
||||
// Because this is an internal change, silence it.
|
||||
this.set('metadata', metadata, { 'silent': true });
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -4262,6 +4262,15 @@ extend(VariantTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
this.max_height_px = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Additional initialization required before drawing track for the first time.
|
||||
*/
|
||||
predraw_init: function() {
|
||||
if (!this.dataset.get_metadata('sample_names')) {
|
||||
return this.dataset.fetch();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Actions to be taken after draw has been completed. Draw is completed when all tiles have been
|
||||
* drawn/fetched and shown.
|
||||
|
||||
Reference in New Issue
Block a user