enhance: scrollable + downloadable HighlightCode (#4397)

* Auto hidding content that is longer than 600 characters long.

* Added basic downloading

Slightly broken

* Better downloading

now downloads file on button click

* Fix the angry linter

* Fix dist

* Removed collapsing, added scrolling.

* Code clean up.

* CSS fix.

* prevent HighlightCode from scrolling entire document

* center "Download" text in button

* `this.downloadJSON` -> `this.downloadText`

we're always saving as `.txt`, so JSON is a misnomer

* hide Download button behind option `downloadable` prop

* `file-saver` -> `js-file-download`
This commit is contained in:
Giancarlo Klemm Camilo
2018-04-12 18:18:49 -07:00
committed by kyle
parent 2bf2167a18
commit 2795518340
4 changed files with 72 additions and 7 deletions

View File

@@ -626,6 +626,32 @@
}
}
.highlight-code {
position: relative;
> .microlight {
overflow-y: auto;
max-height: 400px;
}
}
.download-contents {
position: absolute;
bottom: 10px;
right: 10px;
cursor: pointer;
background: #7d8293;
text-align: center;
padding: 5px;
border-radius: 4px;
font-family: 'Titillium Web', sans-serif;
font-weight: 600;
color: white;
font-size: 14px;
height: 30px;
width: 75px;
}
.scheme-container
{
margin: 0 0 20px 0;