diff --git a/varify/static/js/min/ui/workflows/workspace.js b/varify/static/js/min/ui/workflows/workspace.js index 8cd942e8..e3ee01ad 100644 --- a/varify/static/js/min/ui/workflows/workspace.js +++ b/varify/static/js/min/ui/workflows/workspace.js @@ -1 +1 @@ -define(["cilantro","marionette","../sample","../../utils"],function(e,t,n,r){var i=e.ui.WorkspaceWorkflow.extend({template:"varify/workflows/workspace",ui:{sampleVariantSetHelp:"[data-target=sample-variant-set-help]",createVariantSetButton:"[data-target=create-variant-set]"},events:{"click @ui.createVariantSetButton":"onCreateVariantSetClicked"},regions:{queries:"[data-target=query-region]",publicQueries:"[data-target=public-query-region]",sampleDetail:"[data-target=sample-details-region]",sampleVariantSets:"[data-target=sample-variant-sets-region]"},regionViews:{queries:e.ui.QueryList,publicQueries:e.ui.QueryList,sampleDetail:n.SampleDetail,sampleVariantSets:n.SampleVariantSets},initialize:function(t){e.ui.WorkspaceWorkflow.prototype.initialize.call(this,t);if(!(this.data.samples=this.options.samples))throw new Error("samples collection required")},onCreateVariantSetClicked:function(){e.dialogs.variantSet.open(this.sample)},onRender:function(){e.ui.WorkspaceWorkflow.prototype.onRender.call(this),this.ui.sampleVariantSetHelp.tooltip({title:"A variant set is a fixed set of sample variants that can be annotated and augmented at the creator's discretion."}),this.listenTo(this.data.samples,"select",this.onSampleSelected);if(this.sample===undefined){var t=r.sampleIdsInContext(this.data.context);t.length>0&&(this.sample=this.data.samples.get(t[0]))}this.renderSampleDetail(),this.renderSampleVariantSets()},onSampleSelected:function(e){this.sample=e,this.renderSampleDetail(),this.renderSampleVariantSets()},renderSampleDetail:function(){var e=new this.regionViews.sampleDetail({model:this.sample});this.sampleDetail.show(e)},renderSampleVariantSets:function(){if(!this.sample)return;var e=new this.regionViews.sampleVariantSets({collection:this.sample.variantSets});this.sample.variantSets.fetch({reset:!0}),this.sampleVariantSets.show(e)}});return{WorkspaceWorkflow:i}}) \ No newline at end of file +define(["underscore","cilantro","marionette","../sample","../../utils"],function(e,t,n,r,i){var s=t.ui.WorkspaceWorkflow.extend({template:"varify/workflows/workspace",ui:function(){return e.extend({sampleVariantSetHelp:"[data-target=sample-variant-set-help]",createVariantSetButton:"[data-target=create-variant-set]"},t.ui.WorkspaceWorkflow.prototype.ui)},events:{"click @ui.createVariantSetButton":"onCreateVariantSetClicked"},regions:{queries:"[data-target=query-region]",publicQueries:"[data-target=public-query-region]",sampleDetail:"[data-target=sample-details-region]",sampleVariantSets:"[data-target=sample-variant-sets-region]"},regionViews:{queries:t.ui.QueryList,publicQueries:t.ui.QueryList,sampleDetail:r.SampleDetail,sampleVariantSets:r.SampleVariantSets},initialize:function(e){t.ui.WorkspaceWorkflow.prototype.initialize.call(this,e);if(!(this.data.samples=this.options.samples))throw new Error("samples collection required")},onCreateVariantSetClicked:function(){t.dialogs.variantSet.open(this.sample)},onRender:function(){t.ui.WorkspaceWorkflow.prototype.onRender.call(this),this.ui.sampleVariantSetHelp.tooltip({title:"A variant set is a fixed set of sample variants that can be annotated and augmented at the creator's discretion."}),this.listenTo(this.data.samples,"select",this.onSampleSelected);if(this.sample===undefined){var e=i.sampleIdsInContext(this.data.context);e.length>0&&(this.sample=this.data.samples.get(e[0]))}this.renderSampleDetail(),this.renderSampleVariantSets()},onSampleSelected:function(e){this.sample=e,this.renderSampleDetail(),this.renderSampleVariantSets()},renderSampleDetail:function(){var e=new this.regionViews.sampleDetail({model:this.sample});this.sampleDetail.show(e)},renderSampleVariantSets:function(){if(!this.sample)return;var e=new this.regionViews.sampleVariantSets({collection:this.sample.variantSets});this.sample.variantSets.fetch({reset:!0}),this.sampleVariantSets.show(e)}});return{WorkspaceWorkflow:s}}) \ No newline at end of file diff --git a/varify/static/js/src/ui/workflows/workspace.js b/varify/static/js/src/ui/workflows/workspace.js index f7607bee..360486a4 100644 --- a/varify/static/js/src/ui/workflows/workspace.js +++ b/varify/static/js/src/ui/workflows/workspace.js @@ -1,19 +1,22 @@ /* global define */ define([ + 'underscore', 'cilantro', 'marionette', '../sample', '../../utils' -], function(c, Marionette, sample, utils) { +], function(_, c, Marionette, sample, utils) { var WorkspaceWorkflow = c.ui.WorkspaceWorkflow.extend({ template: 'varify/workflows/workspace', - ui: { - sampleVariantSetHelp: '[data-target=sample-variant-set-help]', - createVariantSetButton: '[data-target=create-variant-set]' + ui: function() { + return _.extend({ + sampleVariantSetHelp: '[data-target=sample-variant-set-help]', + createVariantSetButton: '[data-target=create-variant-set]' + }, c.ui.WorkspaceWorkflow.prototype.ui); }, events: { diff --git a/varify/static/templates/workflows/workspace.html b/varify/static/templates/workflows/workspace.html index f854b299..8683f6ee 100644 --- a/varify/static/templates/workflows/workspace.html +++ b/varify/static/templates/workflows/workspace.html @@ -18,3 +18,7 @@