From: Benjamin Auder Date: Thu, 17 Jan 2019 15:06:33 +0000 (+0100) Subject: Modals first on page to avoid 'scroll to the end' effect X-Git-Url: https://git.auder.net/variants/img/pieces/css/vendor/R.css?a=commitdiff_plain;h=be5efe81c20cd3f1990a857b63613d40cde49217;p=vchess.git Modals first on page to avoid 'scroll to the end' effect --- 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]) {