Update index.js
This commit is contained in:
parent
814adbd334
commit
78c0a99b72
@ -85,6 +85,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Load paste on page load
|
// Load paste on page load
|
||||||
async function loadPasteFromUrl() {
|
async function loadPasteFromUrl() {
|
||||||
|
$viewer.text("Loading...");
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const pasteId = urlParams.get('id');
|
const pasteId = urlParams.get('id');
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ $(document).ready(function() {
|
|||||||
const response = await fetch(`/api/pastes/${pasteId}`);
|
const response = await fetch(`/api/pastes/${pasteId}`);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
$('pre').css('width', '100%'); // Set pre width
|
||||||
const content = await response.text();
|
const content = await response.text();
|
||||||
$editor.val(content);
|
$editor.val(content);
|
||||||
updateLineNumbers();
|
updateLineNumbers();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user