This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Combines some of the common flex item attributes to simplify usage. | |
@mixin flex-item($order: false , $flexgrow: 0 , $flexshrink: 1, $flexbasis: auto, $alignself: false) { | |
//values: | |
// $order: <integer> | |
// $flexgrow: <number> (default 0) | |
// $flexshrink: <number> (default 1) | |
// $flexbasis: <length> | auto (default auto) | |
// $alignself: auto | flex-start | flex-end | center | baseline | stretch | |
// We use long hand so as not to confuse IE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Combines some of the common grid item attributes to simplify usage. | |
@mixin grid-item($gridcolumnstart: false, $gridcolumnend: false, $gridrowstart: false, $gridrowend: false, $gridarea: false, $justifyself: false, $alignself: false) { | |
//values: | |
// $gridcolumnstart: <line> | span <number> | span <name> | auto | |
// $gridcolumnend: <line> | span <number> | span <name> | auto | |
// $gridrowstart: <line> | span <number> | span <name> | auto | |
// $gridrowend: <line> | span <number> | span <name> | auto | |
// $gridarea: <name> | <row-start> / <column-start> / <row-end> / <column-end> | |
// $justifyself: start | end | center | stretch | |
// $alignself: start | end | center | stretch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* A JavaScript file for the theme. | |
* This file finds text with ®s that are dynamically add and wraps them in <sup> | |
* | |
*/ | |
// JavaScript should be made compatible with libraries other than jQuery by | |
// wrapping it with an "anonymous closure". See: | |
// - https://drupal.org/node/1446420 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* A JavaScript file for the theme. | |
* This file should be used as a template for your other js files. | |
* It defines a drupal behavior the "Drupal way". | |
* | |
*/ | |
// JavaScript should be made compatible with libraries other than jQuery by | |
// wrapping it with an "anonymous closure". See: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
// Safe, scoped JavaScript here. Phew. | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |