mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Add toggle for reader mode
This commit is contained in:
@ -26,11 +26,13 @@ const app = new Vue({
|
||||
downloadLink: {},
|
||||
displayBottomToolBar: false,
|
||||
openPreviousPastesMenu: false,
|
||||
readerMode: false,
|
||||
isUploading: false,
|
||||
currentPaste: {
|
||||
ownerKey: '',
|
||||
id: '',
|
||||
type: '',
|
||||
content: ''
|
||||
},
|
||||
newPaste: {
|
||||
expiration: '1_day',
|
||||
@ -66,6 +68,28 @@ const app = new Vue({
|
||||
},
|
||||
methods: {
|
||||
|
||||
toggleReaderMode: function () {
|
||||
if (!this.readerMode) {
|
||||
this.messages = [];
|
||||
this.currentPaste.content = zerobin.getPasteContent();
|
||||
}
|
||||
|
||||
this.readerMode = !this.readerMode;
|
||||
},
|
||||
|
||||
increaseFontSize: function (amount) {
|
||||
let readableModeContent = document.getElementById('readable-paste-content')
|
||||
|
||||
let fontSize = window.getComputedStyle(readableModeContent, null).getPropertyValue('font-size');
|
||||
|
||||
amount = amount || 5;
|
||||
readableModeContent.style.fontSize = (parseFloat(fontSize) + amount) + "px";
|
||||
},
|
||||
|
||||
decreaseFontSize: function () {
|
||||
this.increaseFontSize(-5);
|
||||
},
|
||||
|
||||
formatEmail: (email) => {
|
||||
return "mailto:" + email.replace('__AT__', '@');
|
||||
},
|
||||
|
Reference in New Issue
Block a user