aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/common
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-10 10:24:09 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-11 12:02:21 +0200
commit0b9d353145660ea802d50f2c3e177976ac26724c (patch)
tree0dc2367bc6b490c29bc14f9d7d853d0d977ecde6 /server/sonar-web/src/main/js/components/common
parentba47e7fd393657a540cdee36df8ba362b671069d (diff)
downloadsonarqube-0b9d353145660ea802d50f2c3e177976ac26724c.tar.gz
sonarqube-0b9d353145660ea802d50f2c3e177976ac26724c.zip
SONAR-9690 Improve positioning of secondary locations markers
Diffstat (limited to 'server/sonar-web/src/main/js/components/common')
-rw-r--r--server/sonar-web/src/main/js/components/common/LocationIndex.css6
-rw-r--r--server/sonar-web/src/main/js/components/common/LocationIndex.js8
2 files changed, 12 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/components/common/LocationIndex.css b/server/sonar-web/src/main/js/components/common/LocationIndex.css
index 73b5cd8986e..a1da0ffdefd 100644
--- a/server/sonar-web/src/main/js/components/common/LocationIndex.css
+++ b/server/sonar-web/src/main/js/components/common/LocationIndex.css
@@ -21,6 +21,12 @@
background-color: #ccc;
}
+.location-index.is-leading {
+ position: absolute;
+ margin: 1px 0 0 -4px !important;
+ transform: translateX(-100%);
+}
+
.location-index[tabindex] {
cursor: pointer;
}
diff --git a/server/sonar-web/src/main/js/components/common/LocationIndex.js b/server/sonar-web/src/main/js/components/common/LocationIndex.js
index 2effb6e44ca..43ddc0de0bf 100644
--- a/server/sonar-web/src/main/js/components/common/LocationIndex.js
+++ b/server/sonar-web/src/main/js/components/common/LocationIndex.js
@@ -25,18 +25,22 @@ import './LocationIndex.css';
/*::
type Props = {
children?: React.Element<*>,
+ leading?: boolean,
onClick?: () => void,
selected?: boolean
};
*/
export default function LocationIndex(props /*: Props */) {
- const { children, onClick, selected, ...other } = props;
+ const { children, leading, onClick, selected, ...other } = props;
const clickAttributes = onClick ? { onClick, role: 'button', tabIndex: 0 } : {};
// put {...others} because Tooltip sets some event handlers
return (
- <div className={classNames('location-index', { selected })} {...clickAttributes} {...other}>
+ <div
+ className={classNames('location-index', { 'is-leading': leading, selected })}
+ {...clickAttributes}
+ {...other}>
{children}
</div>
);