Skip to content

Commit

Permalink
add a "Save" button to the bottom of the export view dialog, so peopl…
Browse files Browse the repository at this point in the history
…e can save the data if they want after they view it
  • Loading branch information
rbuels committed Nov 3, 2012
1 parent 03244a5 commit f297b21
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/JBrowse/View/Track/ExportMixin.js
Expand Up @@ -113,10 +113,26 @@ return {
readonly: true
});
text.value = output;
var content = text;
if( ! (has('ie') < 10) ) { // data URL download doesn't work on IE < 10
var actionBar = dojo.create( 'div', {
className: 'dijitDialogPaneActionBar'
});
var saveButton = new dijitButton(
{
iconClass: 'dijitIconSave',
label: 'Save',
onClick: dojo.hitch(this, function() {
exportView.hide();
window.location.href="data:application/x-"+format.toLowerCase()+","+escape(output);
})
}).placeAt(actionBar);
content = [ content, actionBar ];
}
var exportView = new dijitDialog({
className: 'export-view-dialog',
title: format + ' export - <span class="locString">'+ region+'</span> ('+Util.humanReadableNumber(output.length)+'b)',
content: text
content: [ text, actionBar ]
});
aspect.after( exportView, 'hide', function() {
text.parentNode.removeChild( text ); // manually unhook and free the (possibly huge) text area
Expand Down

0 comments on commit f297b21

Please sign in to comment.