Browse Source

Fixed the snackbar

n1474335 2 years ago
parent
commit
ff45f61b68

+ 10 - 0
Gruntfile.js

@@ -398,6 +398,16 @@ module.exports = function (grunt) {
                     `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`
                 ].join(" "),
                 stdout: false
+            },
+            fixSnackbarMarkup: {
+                command: [
+                    `[[ "$OSTYPE" == "darwin"* ]]`,
+                    "&&",
+                    `sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`,
+                    "||",
+                    `sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`
+                ].join(" "),
+                stdout: false
             }
         },
     });

+ 1 - 1
package.json

@@ -184,7 +184,7 @@
     "testui": "npx grunt testui",
     "testuidev": "npx nightwatch --env=dev",
     "lint": "npx grunt lint",
-    "postinstall": "npx grunt exec:fixCryptoApiImports",
+    "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup",
     "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
     "minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs",
     "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",

+ 1 - 1
src/web/stylesheets/layout/_modals.css

@@ -107,4 +107,4 @@
     background-image:
         linear-gradient(to top, var(--input-highlight-colour) 2px, rgba(0, 0, 0, 0) 2px),
         linear-gradient(to top, var(--primary-border-colour) 1px, rgba(0, 0, 0, 0) 1px);
-}
+}

+ 1 - 1
src/web/utils/statusBar.mjs

@@ -111,7 +111,7 @@ class StatusBarPanel {
      */
     chrEncSelectClick(e) {
         // preventDefault is required to stop the URL being modified and popState being triggered
-        e.preventDefault(); // TODO - this breaks the menus when you click the button itself
+        e.preventDefault();
 
         const chrEncVal = parseInt(e.target.getAttribute("data-val"), 10);
 

+ 1 - 1
src/web/waiters/OutputWaiter.mjs

@@ -1274,7 +1274,7 @@ class OutputWaiter {
      * Handler for copy click events.
      * Copies the output to the clipboard
      */
-    async copyClick() { // TODO - do we need this?
+    async copyClick() {
         const dish = this.getOutputDish(this.manager.tabs.getActiveTab("output"));
         if (dish === null) {
             this.app.alert("Could not find data to copy. Has this output been baked yet?", 3000);