visuddhinanda 2 anni fa
parent
commit
4a7f0e2bc4
1 ha cambiato i file con 12 aggiunte e 4 eliminazioni
  1. 12 4
      dashboard/src/components/article/TypePage.tsx

+ 12 - 4
dashboard/src/components/article/TypePage.tsx

@@ -131,7 +131,7 @@ const TypeTermWidget = ({
           <NavigateButton
           <NavigateButton
             prevTitle={nav?.prev.page.toString()}
             prevTitle={nav?.prev.page.toString()}
             nextTitle={nav?.next.page.toString()}
             nextTitle={nav?.next.page.toString()}
-            onNext={() => {
+            onNext={(event: React.MouseEvent<HTMLElement, MouseEvent>) => {
               if (typeof onArticleChange !== "undefined") {
               if (typeof onArticleChange !== "undefined") {
                 if (typeof articleId === "undefined") {
                 if (typeof articleId === "undefined") {
                   return;
                   return;
@@ -143,10 +143,14 @@ const TypeTermWidget = ({
                 const id = `${pageParam[0]}-${pageParam[1]}-${pageParam[2]}-${
                 const id = `${pageParam[0]}-${pageParam[1]}-${pageParam[2]}-${
                   parseInt(pageParam[3]) + 1
                   parseInt(pageParam[3]) + 1
                 }`;
                 }`;
-                onArticleChange("page", id);
+                let target = "_self";
+                if (event.ctrlKey || event.metaKey) {
+                  target = "_blank";
+                }
+                onArticleChange("page", id, target);
               }
               }
             }}
             }}
-            onPrev={() => {
+            onPrev={(event: React.MouseEvent<HTMLElement, MouseEvent>) => {
               if (typeof onArticleChange !== "undefined") {
               if (typeof onArticleChange !== "undefined") {
                 if (typeof articleId === "undefined") {
                 if (typeof articleId === "undefined") {
                   return;
                   return;
@@ -158,7 +162,11 @@ const TypeTermWidget = ({
                 const id = `${pageParam[0]}-${pageParam[1]}-${pageParam[2]}-${
                 const id = `${pageParam[0]}-${pageParam[1]}-${pageParam[2]}-${
                   parseInt(pageParam[3]) - 1
                   parseInt(pageParam[3]) - 1
                 }`;
                 }`;
-                onArticleChange("page", id);
+                let target = "_self";
+                if (event.ctrlKey || event.metaKey) {
+                  target = "_blank";
+                }
+                onArticleChange("page", id, target);
               }
               }
             }}
             }}
           />
           />