Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
window.sptb = {
|
||||
downloadFile: function(fileName, contentType, base64) {
|
||||
var link = document.createElement('a');
|
||||
link.download = fileName;
|
||||
link.href = 'data:' + contentType + ';base64,' + base64;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
setTheme: function(theme) {
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
},
|
||||
scrollToBottom: function(el) {
|
||||
if (el) el.scrollTop = el.scrollHeight;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user