Skip to content

Commit f7efd58

Browse files
author
Surya
committed
Removed href attribute from anchor tag if deeplinking is disabled
1 parent b6cd504 commit f7efd58

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

src/core/components/operation.jsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ export default class Operation extends PureComponent {
161161
<div className={`opblock-summary opblock-summary-${method}`} onClick={this.toggleShown} >
162162
<span className="opblock-summary-method">{method.toUpperCase()}</span>
163163
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
164-
<a
165-
className="nostyle"
166-
onClick={(e) => e.preventDefault()}
167-
href={ isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : ""} >
168-
<span>{path}</span>
169-
</a>
164+
{
165+
isDeepLinkingEnabled ?
166+
<a
167+
className="nostyle"
168+
onClick={(e) => e.preventDefault()}
169+
href={`#/${isShownKey[1]}/${isShownKey[2]}`}>
170+
<span>{path}</span>
171+
</a> :
172+
<a className="nostyle">
173+
<span>{path}</span>
174+
</a>
175+
}
170176
<JumpToPath path={jumpToKey} />
171177
</span>
172178

src/core/components/operations.jsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,18 @@ export default class Operations extends React.Component {
7979
onClick={() => layoutActions.show(isShownKey, !showTag)}
8080
className={!tagDescription ? "opblock-tag no-desc" : "opblock-tag" }
8181
id={isShownKey.join("-")}>
82-
<a
83-
className="nostyle"
84-
onClick={(e) => e.preventDefault()}
85-
href={ isDeepLinkingEnabled ? `#/${tag}` : ""}>
86-
<span>{tag}</span>
87-
</a>
82+
{
83+
isDeepLinkingEnabled ?
84+
<a
85+
className="nostyle"
86+
onClick={(e) => e.preventDefault()}
87+
href= {`#/${tag}`}>
88+
<span>{tag}</span>
89+
</a>:
90+
<a className="nostyle">
91+
<span>{tag}</span>
92+
</a>
93+
}
8894
{ !tagDescription ? null :
8995
<small>
9096
{ tagDescription }

0 commit comments

Comments
 (0)