From be5efe81c20cd3f1990a857b63613d40cde49217 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Thu, 17 Jan 2019 16:06:33 +0100 Subject: [PATCH] Modals first on page to avoid 'scroll to the end' effect --- public/javascripts/components/problems.js | 96 +++++++++++------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index d1ec9a21..51453a4c 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -23,8 +23,54 @@ Vue.component('my-problems', { }, }; }, + // NOTE: always modals first, because otherwise "scroll to the end" undesirable effect template: `
+ +
+
+ +

{{ translate("Add a problem") }}

+
+
+ + +
+
+

{{ translate("Safe HTML tags allowed") }}

+ + + + + +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+ +

{{ nomoreMessage }}

+
+
+
- - -
-
- - - -
- - -
-
- - -
-
- -

{{ nomoreMessage }}

-
-
`, watch: { @@ -138,8 +139,7 @@ Vue.component('my-problems', { this.fetchProblems("mine", "bacwkard"); this.listsInitialized = true; }, - showProblem: function(num) { - const pid = num || this.pbNum; + showProblem: function(pid) { location.hash = "#problems?id=" + pid; for (let parray of [this.singletons,this.problems,this.myProblems]) { -- 2.44.0