Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Commit c3fe0a0

Browse files
author
Colin McLeod
committed
UI Tweaks
1 parent 1544deb commit c3fe0a0

File tree

7 files changed

+28
-20
lines changed

7 files changed

+28
-20
lines changed

src/app/Coriolis.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default class Coriolis extends React.Component {
5454

5555
this.emitter = new EventEmitter();
5656
this.state = {
57+
noTouch: !window.ontouchstart && !navigator.MaxTouchPoints && !navigator.msMaxTouchPoints,
5758
page: null,
5859
language: getLanguage(Persist.getLangCode()),
5960
route: {},
@@ -281,7 +282,7 @@ export default class Coriolis extends React.Component {
281282
render() {
282283
let currentMenu = this.state.currentMenu;
283284

284-
return <div onClick={this._closeMenu}>
285+
return <div onClick={this._closeMenu} className={ this.state.noTouch ? 'no-touch' : null }>
285286
<Header appCacheUpdate={this.state.appCacheUpdate} currentMenu={currentMenu} />
286287
{ this.state.error ? this.state.error : this.state.page ? React.createElement(this.state.page, { currentMenu }) : <NotFoundPage/> }
287288
{ this.state.modal }

src/app/components/AvailableModulesMenu.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
173173
* @param {SyntheticEvent} event Event
174174
*/
175175
_touchStart(showDiff, event) {
176+
event.preventDefault();
176177
let rect = event.currentTarget.getBoundingClientRect();
177178
this.touchTimeout = setTimeout(showDiff.bind(this, rect), PRESS_THRESHOLD);
178179
}

src/app/utils/SlotFunctions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const PROP_BLACKLIST = {
9090
eddbID: 1,
9191
edID: 1,
9292
id: 1,
93+
index: 1,
9394
'class': 1,
95+
rating: 1,
9496
maxfuel: 1,
9597
fuelmul: 1,
9698
fuelpower: 1,
@@ -175,7 +177,7 @@ function diff(format, mVal, mmVal) {
175177
return <Infinite/>;
176178
} else {
177179
let diff = mVal - mmVal;
178-
if (!diff || !mVal || diff == mVal || Math.abs(diff) == Infinity) {
180+
if (!diff || mVal === undefined || diff == mVal || Math.abs(diff) == Infinity) {
179181
return format(mVal);
180182
}
181183
return `${format(mVal)} (${diff > 0 ? '+' : ''}${format(diff)})`;

src/less/header.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ header {
9797

9898
input {
9999
border: none;
100+
background-color: transparent;
100101
text-align: right;
101102
font-size: 1em;
102103
font-family: @fStandard;
@@ -171,7 +172,7 @@ header {
171172
&:visited {
172173
color: @warning;
173174
}
174-
&:hover {
175+
.no-touch &:hover {
175176
color: teal;
176177
}
177178
&.active {

src/less/select.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ select {
7878
stroke-width: 0.5em;
7979
stroke: @primary-disabled;
8080

81-
&:hover {
81+
.no-touch &:hover {
8282
border-color: @primary;
8383
color: @primary;
8484
stroke: @primary;
@@ -95,7 +95,7 @@ select {
9595
color: @warning-disabled;
9696
stroke: @warning-disabled;
9797

98-
&:hover {
98+
.no-touch &:hover {
9999
border-color: @warning;
100100
color: @warning;
101101
stroke: @warning;

src/less/sortable.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.user-select-none();
33
cursor: pointer;
44

5-
&:hover {
5+
.no-touch &:hover {
66
color: @primary;
77
}
88
}

src/less/table.less

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ thead {
3333
&.lft {
3434
border-left: 1px solid @primary-bg;
3535
}
36+
37+
&.rgt {
38+
border-right: 1px solid @primary-bg;
39+
}
3640
}
3741
}
3842

@@ -42,24 +46,23 @@ tbody tr {
4246
color: @fg;
4347
text-align: right;
4448
}
49+
}
4550

46-
td {
47-
line-height: 1.4em;
48-
padding: 0 0.3em;
51+
td {
52+
line-height: 1.4em;
53+
padding: 0 0.3em;
4954

50-
&.val {
51-
border: 1px solid @primary-disabled;
52-
}
53-
&.lbl {
54-
border: 1px solid @primary-disabled;
55-
text-transform: uppercase;
56-
color: @primary-bg;
57-
background-color: @primary-disabled;
58-
}
55+
&.val {
56+
border: 1px solid @primary-disabled;
57+
}
58+
59+
&.lbl {
60+
border: 1px solid @primary-disabled;
61+
text-transform: uppercase;
62+
color: @primary-bg;
63+
background-color: @primary-disabled;
5964
}
60-
}
6165

62-
td {
6366
&.tl {
6467
text-align: left;
6568
padding-left: 0.7em;

0 commit comments

Comments
 (0)