From f7efd583059ed0be53ea757102d6c7adaaf140db Mon Sep 17 00:00:00 2001 From: Surya Date: Fri, 25 Aug 2017 23:08:56 +0530 Subject: [PATCH 1/3] Removed href attribute from anchor tag if deeplinking is disabled --- src/core/components/operation.jsx | 18 ++++++++++++------ src/core/components/operations.jsx | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index b84b40c6..9f32303b 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -161,12 +161,18 @@ export default class Operation extends PureComponent {
{method.toUpperCase()} - e.preventDefault()} - href={ isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : ""} > - {path} - + { + isDeepLinkingEnabled ? + e.preventDefault()} + href={`#/${isShownKey[1]}/${isShownKey[2]}`}> + {path} + : + + {path} + + } diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index ef1d4248..5610275d 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -79,12 +79,18 @@ export default class Operations extends React.Component { onClick={() => layoutActions.show(isShownKey, !showTag)} className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" } id={isShownKey.join("-")}> - e.preventDefault()} - href={ isDeepLinkingEnabled ? `#/${tag}` : ""}> - {tag} - + { + isDeepLinkingEnabled ? + e.preventDefault()} + href= {`#/${tag}`}> + {tag} + : + + {tag} + + } { !tagDescription ? null : { tagDescription } From f63d2b1ae8000c518901dbe65a92b7e0e689581e Mon Sep 17 00:00:00 2001 From: Surya Date: Fri, 25 Aug 2017 23:10:21 +0530 Subject: [PATCH 2/3] If deeplinking is disabled the anchor tag has no href attribute as a result the mouse pointer is not a pointer as it is no longer a hyperlink, setting the cursor explicitly to pointer. --- src/style/_layout.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/style/_layout.scss b/src/style/_layout.scss index 9ee357f0..427c7dc5 100644 --- a/src/style/_layout.scss +++ b/src/style/_layout.scss @@ -726,12 +726,12 @@ section a.nostyle { text-decoration: inherit; color: inherit; - cursor: auto; + cursor: pointer; display: inline; &:visited { text-decoration: inherit; color: inherit; - cursor: auto; + cursor: pointer; } } From 5da3843281645c95ddc213ceddf24a088d0e6c88 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 25 Aug 2017 12:06:11 -0700 Subject: [PATCH 3/3] Refactor: use ternary operators at attribute level instead of element level --- src/core/components/operation.jsx | 18 ++++++------------ src/core/components/operations.jsx | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index 9f32303b..eb21b8db 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -161,18 +161,12 @@ export default class Operation extends PureComponent {
{method.toUpperCase()} - { - isDeepLinkingEnabled ? - e.preventDefault()} - href={`#/${isShownKey[1]}/${isShownKey[2]}`}> - {path} - : - - {path} - - } + e.preventDefault() : null} + href={isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : null}> + {path} + diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx index 5610275d..2aec664a 100644 --- a/src/core/components/operations.jsx +++ b/src/core/components/operations.jsx @@ -79,18 +79,12 @@ export default class Operations extends React.Component { onClick={() => layoutActions.show(isShownKey, !showTag)} className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" } id={isShownKey.join("-")}> - { - isDeepLinkingEnabled ? - e.preventDefault()} - href= {`#/${tag}`}> - {tag} - : - - {tag} - - } + e.preventDefault() : null} + href= {isDeepLinkingEnabled ? `#/${tag}` : null}> + {tag} + { !tagDescription ? null : { tagDescription }