From 1746db8e37e48b363737843354976ba7318581eb Mon Sep 17 00:00:00 2001 From: TT-392 Date: Mon, 25 Nov 2024 19:17:31 +0100 Subject: [PATCH] Remember scroll position, and automatically scroll to bottom page when print button appears --- app.py | 7 ++++--- templates/base.html | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index f37795e..d51509d 100644 --- a/app.py +++ b/app.py @@ -48,8 +48,8 @@ templates = { } -def render_text_template(info=None, info_color=None): - return render_template('text.html', filename=session["text image path"], text1=session["text1"], text2=session["text2"], cut=session["cut"], info=info, info_color=info_color) +def render_text_template(info=None, info_color=None, scrollDown=None): + return render_template('text.html', filename=session["text image path"], text1=session["text1"], text2=session["text2"], cut=session["cut"], info=info, info_color=info_color, scrollDown=scrollDown) @@ -176,10 +176,11 @@ def text_form(): session["text image path"] = text_image_filename img.save(get_file_path(session, session["text image path"])) + print() print(session["text image path"]) - return render_text_template() + return render_text_template(scrollDown = True) @app.route('/text', methods=['GET', 'POST']) diff --git a/templates/base.html b/templates/base.html index c737d0a..7d26f2a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -82,6 +82,21 @@ + +
Text