visuddhinanda 1 год назад
Родитель
Сommit
f89988ca64

+ 3 - 0
dashboard/src/components/article/Article.tsx

@@ -58,6 +58,7 @@ interface IWidget {
   focus?: string | null;
   focus?: string | null;
   hideInteractive?: boolean;
   hideInteractive?: boolean;
   hideTitle?: boolean;
   hideTitle?: boolean;
+  isSubWindow?: boolean;
   onArticleChange?: Function;
   onArticleChange?: Function;
   onLoad?: Function;
   onLoad?: Function;
   onAnthologySelect?: Function;
   onAnthologySelect?: Function;
@@ -77,6 +78,7 @@ const ArticleWidget = ({
   focus,
   focus,
   hideInteractive = false,
   hideInteractive = false,
   hideTitle = false,
   hideTitle = false,
+  isSubWindow = false,
   onArticleChange,
   onArticleChange,
   onLoad,
   onLoad,
   onAnthologySelect,
   onAnthologySelect,
@@ -91,6 +93,7 @@ const ArticleWidget = ({
       <DiscussionCount courseId={type === "textbook" ? courseId : undefined} />
       <DiscussionCount courseId={type === "textbook" ? courseId : undefined} />
       {type === "article" ? (
       {type === "article" ? (
         <TypeArticle
         <TypeArticle
+          isSubWindow={isSubWindow}
           type={type}
           type={type}
           articleId={onArticleChange ? articleId : currId}
           articleId={onArticleChange ? articleId : currId}
           channelId={channelId}
           channelId={channelId}

+ 3 - 0
dashboard/src/components/article/TypeArticle.tsx

@@ -15,6 +15,7 @@ interface IWidget {
   active?: boolean;
   active?: boolean;
   hideInteractive?: boolean;
   hideInteractive?: boolean;
   hideTitle?: boolean;
   hideTitle?: boolean;
+  isSubWindow?: boolean;
   onArticleChange?: Function;
   onArticleChange?: Function;
   onArticleEdit?: Function;
   onArticleEdit?: Function;
   onLoad?: Function;
   onLoad?: Function;
@@ -29,6 +30,7 @@ const TypeArticleWidget = ({
   active = false,
   active = false,
   hideInteractive = false,
   hideInteractive = false,
   hideTitle = false,
   hideTitle = false,
+  isSubWindow = false,
   onArticleChange,
   onArticleChange,
   onLoad,
   onLoad,
   onAnthologySelect,
   onAnthologySelect,
@@ -61,6 +63,7 @@ const TypeArticleWidget = ({
         />
         />
       ) : (
       ) : (
         <TypeArticleReader
         <TypeArticleReader
+          isSubWindow={isSubWindow}
           type={type}
           type={type}
           channelId={channelId}
           channelId={channelId}
           articleId={articleId}
           articleId={articleId}

+ 3 - 0
dashboard/src/components/article/TypeArticleReader.tsx

@@ -29,6 +29,7 @@ interface IWidget {
   active?: boolean;
   active?: boolean;
   hideInteractive?: boolean;
   hideInteractive?: boolean;
   hideTitle?: boolean;
   hideTitle?: boolean;
+  isSubWindow?: boolean;
   onArticleChange?: Function;
   onArticleChange?: Function;
   onLoad?: Function;
   onLoad?: Function;
   onAnthologySelect?: Function;
   onAnthologySelect?: Function;
@@ -43,6 +44,7 @@ const TypeArticleReaderWidget = ({
   active = false,
   active = false,
   hideInteractive = false,
   hideInteractive = false,
   hideTitle = false,
   hideTitle = false,
+  isSubWindow = false,
   onArticleChange,
   onArticleChange,
   onLoad,
   onLoad,
   onAnthologySelect,
   onAnthologySelect,
@@ -192,6 +194,7 @@ const TypeArticleReaderWidget = ({
             articleId={articleId}
             articleId={articleId}
             anthologyId={anthologyId}
             anthologyId={anthologyId}
             role={articleData?.role}
             role={articleData?.role}
+            isSubWindow={isSubWindow}
             onEdit={() => {
             onEdit={() => {
               if (typeof onEdit !== "undefined") {
               if (typeof onEdit !== "undefined") {
                 onEdit();
                 onEdit();

+ 1 - 0
dashboard/src/components/template/Article.tsx

@@ -64,6 +64,7 @@ export const ArticleCtl = ({
       mode="read"
       mode="read"
       hideInteractive={true}
       hideInteractive={true}
       hideTitle={true}
       hideTitle={true}
+      isSubWindow
     />
     />
   );
   );
   let output = <></>;
   let output = <></>;