Skip to content

Commit

Permalink
add a Close button to the bottom of the export-view dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Nov 3, 2012
1 parent f297b21 commit c14502f
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/JBrowse/View/Track/ExportMixin.js
Expand Up @@ -113,12 +113,22 @@ 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(
var actionBar = dojo.create( 'div', {
className: 'dijitDialogPaneActionBar'
});
var exportView = new dijitDialog({
className: 'export-view-dialog',
title: format + ' export - <span class="locString">'+ region+'</span> ('+Util.humanReadableNumber(output.length)+'b)',
content: [ text, actionBar ]
});
new dijitButton({ iconClass: 'dijitIconDelete',
label: 'Close', onClick: dojo.hitch( exportView, 'hide' )
})
.placeAt(actionBar);

// data URL download doesn't work on IE < 10
if( ! (has('ie') < 10) ) {
new dijitButton(
{
iconClass: 'dijitIconSave',
label: 'Save',
Expand All @@ -127,13 +137,8 @@ return {
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, actionBar ]
});

aspect.after( exportView, 'hide', function() {
text.parentNode.removeChild( text ); // manually unhook and free the (possibly huge) text area
text = null;
Expand Down

0 comments on commit c14502f

Please sign in to comment.