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