{Ships[shipId].properties.name}
-
+
{translate(b.useName == '' ? 'skip' : (hasBuild ? 'overwrite' : 'create'))}
@@ -491,7 +498,7 @@ export default class ModalImport extends TranslatedComponent {
{comparisonTable}
- {translate('import')}
+ {translate('import')}
{edit}
);
diff --git a/src/app/components/PowerManagement.jsx b/src/app/components/PowerManagement.jsx
index c2a3bef0..0345d895 100644
--- a/src/app/components/PowerManagement.jsx
+++ b/src/app/components/PowerManagement.jsx
@@ -130,9 +130,9 @@ export default class PowerManagement extends TranslatedComponent {
{slotName(translate, slot)}
{translate(slot.type)}
- ►
+ ►
{' ' + (slot.priority + 1) + ' '}
- ►
+ ►
{pwr(m.power)}
{pct(m.power / ship.powerAvailable)}
diff --git a/src/app/components/Slider.jsx b/src/app/components/Slider.jsx
index 3d55fd30..2df2c774 100644
--- a/src/app/components/Slider.jsx
+++ b/src/app/components/Slider.jsx
@@ -32,29 +32,35 @@ export default class Slider extends React.Component {
/**
* On Mouse down handler
- * @param {SyntheticEvent} e Event
+ * @param {SyntheticEvent} event Event
*/
- down(e) {
- let rect = e.currentTarget.getBoundingClientRect();
- this.move = this._updatePercent.bind(this, rect.left, rect.width);
- this.move(e);
- document.addEventListener('mousemove', this.move);
- document.addEventListener('mouseup', this.up);
+ down(event) {
+ if (this.move) {
+ this.up(event);
+ } else {
+ let rect = event.currentTarget.getBoundingClientRect();
+ this.move = this._updatePercent.bind(this, rect.left, rect.width);
+ this.move(event);
+ document.addEventListener('mousemove', this.move, true);
+ document.addEventListener('mouseup', this.up, true);
+ }
}
/**
* On Mouse up handler
+ * @param {Event} event DOM Event
*/
- up() {
- document.removeEventListener('mousemove', this.move);
- document.removeEventListener('mouseup', this.up);
+ up(event) {
+ document.removeEventListener('mousemove', this.move, true);
+ document.removeEventListener('mouseup', this.up, true);
+ this.move = null;
}
/**
* Update the slider percentage
* @param {number} left Slider left position
* @param {number} width Slider width
- * @param {Event} event Event
+ * @param {Event} event DOM Event
*/
_updatePercent(left, width, event) {
this.props.onChange(Math.min(Math.max((event.clientX - left) / width, 0), 1));
@@ -88,7 +94,7 @@ export default class Slider extends React.Component {
-
+
{axisGroup}
;
}
diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx
index 8db98400..6c634a55 100644
--- a/src/app/pages/OutfittingPage.jsx
+++ b/src/app/pages/OutfittingPage.jsx
@@ -328,10 +328,10 @@ export default class OutfittingPage extends Page {
-
+
-
+
{formats.f2(fuelLevel * fuelCapacity)}{units.T} {formats.pct1(fuelLevel)}
diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js
index 9947849c..0d4ee53b 100755
--- a/src/app/shipyard/Ship.js
+++ b/src/app/shipyard/Ship.js
@@ -415,12 +415,10 @@ export default class Ship {
this.updatePower()
.updateJumpStats()
.updateShieldStrength()
- .updateTopSpeed()
- .updatePowerPrioritesString()
- .updatePowerEnabledString();
+ .updateTopSpeed();
}
- return this;
+ return this.updatePowerPrioritesString().updatePowerEnabledString();
}
/**
@@ -570,12 +568,12 @@ export default class Ship {
if (newPriority >= 0 && newPriority < this.priorityBands.length) {
let oldPriority = slot.priority;
slot.priority = newPriority;
+ this.updatePowerPrioritesString();
if (slot.enabled) { // Only update power if the slot is enabled
let usage = powerUsageType(slot, slot.m);
this.priorityBands[oldPriority][usage] -= slot.m.power;
this.priorityBands[newPriority][usage] += slot.m.power;
- this.updatePowerPrioritesString();
this.updatePower();
}
return true;
diff --git a/src/app/stores/Persist.js b/src/app/stores/Persist.js
index b449fdc5..05506852 100644
--- a/src/app/stores/Persist.js
+++ b/src/app/stores/Persist.js
@@ -14,8 +14,8 @@ let LS;
// Safe check to determine if localStorage is enabled
try {
- localStorage.setItem('s', 1);
- localStorage.removeItem('s');
+ localStorage.setItem('test_string', 1);
+ localStorage.removeItem('test_string');
LS = localStorage;
} catch(e) {
LS = null;
@@ -38,7 +38,7 @@ function _put(key, value) {
* @return {string} The stored string
*/
function _getString(key) {
- return LS.getItem(key);
+ return LS ? LS.getItem(key) : null;
}
/**
@@ -80,7 +80,7 @@ class Persist extends EventEmitter {
this.comparisons = comparisonJson ? comparisonJson : {};
this.buildCount = Object.keys(this.builds).length;
this.langCode = _getString(LS_KEY_LANG) || 'en';
- this.insurance = _getString(LS_KEY_INSURANCE);
+ this.insurance = _getString(LS_KEY_INSURANCE) || 'standard';
this.discounts = _get(LS_KEY_DISCOUNTS) || [1, 1];
this.costTab = _getString(LS_KEY_COST_TAB);
this.state = _get(LS_KEY_STATE);
@@ -129,16 +129,13 @@ class Persist extends EventEmitter {
* @param {string} code The serialized code
*/
saveBuild(shipId, name, code) {
- if (LS) {
- if (!this.builds[shipId]) {
- this.builds[shipId] = {};
- }
- let newBuild = !this.builds[shipId][name];
- this.builds[shipId][name] = code;
- _put(LS_KEY_BUILDS, this.builds);
- this.emit('buildSaved', shipId, name, code);
+ if (!this.builds[shipId]) {
+ this.builds[shipId] = {};
}
- };
+ this.builds[shipId][name] = code;
+ _put(LS_KEY_BUILDS, this.builds);
+ this.emit('buildSaved', shipId, name, code);
+ }
/**
* Get the serialized code/string for a build. Returns null if a
@@ -153,7 +150,7 @@ class Persist extends EventEmitter {
return this.builds[shipId][name];
}
return null;
- };
+ }
/**
* Get all builds (object) or builds for a specific ship (array)
@@ -225,7 +222,7 @@ class Persist extends EventEmitter {
_put(LS_KEY_COMPARISONS, this.comparisons);
this.emit('buildDeleted', shipId, name);
}
- };
+ }
/**
* Persist a comparison in localstorage.
@@ -244,7 +241,7 @@ class Persist extends EventEmitter {
};
_put(LS_KEY_COMPARISONS, this.comparisons);
this.emit('comparisons', this.comparisons);
- };
+ }
/**
* [getComparison description]
@@ -256,7 +253,7 @@ class Persist extends EventEmitter {
return this.comparisons[name];
}
return null;
- };
+ }
/**
* Get all saved comparisons
@@ -293,7 +290,7 @@ class Persist extends EventEmitter {
_put(LS_KEY_COMPARISONS, this.comparisons);
this.emit('comparisons', this.comparisons);
}
- };
+ }
/**
* Delete all builds and comparisons from localStorage
@@ -304,7 +301,7 @@ class Persist extends EventEmitter {
_delete(LS_KEY_BUILDS);
_delete(LS_KEY_COMPARISONS);
this.emit('deletedAll');
- };
+ }
/**
* Get all saved data and settings
@@ -317,25 +314,25 @@ class Persist extends EventEmitter {
data[LS_KEY_INSURANCE] = this.getInsurance();
data[LS_KEY_DISCOUNTS] = this.discounts;
return data;
- };
+ }
/**
* Get the saved insurance type
* @return {string} The name of the saved insurance type of null
*/
getInsurance() {
- return this.insurance;
- };
+ return this.insurance.toLowerCase();
+ }
/**
* Persist selected insurance type
* @param {string} insurance Insurance type name
*/
setInsurance(insurance) {
- this.insurance = insurance;
+ this.insurance = insurance.toLowerCase();
_put(LS_KEY_INSURANCE, insurance);
this.emit('insurance', insurance);
- };
+ }
/**
* Persist selected ship discount
@@ -345,7 +342,7 @@ class Persist extends EventEmitter {
this.discounts[0] = shipDiscount;
_put(LS_KEY_DISCOUNTS, this.discounts);
this.emit('discounts', this.discounts);
- };
+ }
/**
* Get the saved ship discount
@@ -363,7 +360,7 @@ class Persist extends EventEmitter {
this.discounts[1] = moduleDiscount;
_put(LS_KEY_DISCOUNTS, this.discounts);
this.emit('discounts', this.discounts);
- };
+ }
/**
* Get the saved ship discount
@@ -371,7 +368,7 @@ class Persist extends EventEmitter {
*/
getModuleDiscount() {
return this.discounts[1];
- };
+ }
/**
* Persist selected cost tab
@@ -380,7 +377,7 @@ class Persist extends EventEmitter {
setCostTab(tabName) {
this.costTab = tabName;
_put(LS_KEY_COST_TAB, tabName);
- };
+ }
/**
* Get the saved discount
@@ -388,7 +385,7 @@ class Persist extends EventEmitter {
*/
getCostTab() {
return this.costTab;
- };
+ }
/**
* Retrieve the last router state from local storage
@@ -396,7 +393,7 @@ class Persist extends EventEmitter {
*/
getState() {
return this.state;
- };
+ }
/**
* Save the current router state to localstorage
@@ -405,7 +402,7 @@ class Persist extends EventEmitter {
setState(state) {
this.state = state;
_put(LS_KEY_STATE, state);
- };
+ }
/**
* Retrieve the last router state from local storage
@@ -413,7 +410,7 @@ class Persist extends EventEmitter {
*/
getSizeRatio() {
return this.sizeRatio;
- };
+ }
/**
* Save the current size ratio to localstorage
@@ -425,7 +422,7 @@ class Persist extends EventEmitter {
_put(LS_KEY_SIZE_RATIO, sizeRatio);
this.emit('sizeRatio', sizeRatio);
}
- };
+ }
/**
* Check if localStorage is enabled/active
diff --git a/src/index.html b/src/index.html
index ed1d9162..1b27bea7 100755
--- a/src/index.html
+++ b/src/index.html
@@ -2,6 +2,7 @@
Coriolis
+
diff --git a/src/less/charts.less b/src/less/charts.less
index 13a6be5a..20312d9e 100755
--- a/src/less/charts.less
+++ b/src/less/charts.less
@@ -58,7 +58,7 @@ svg {
fill: @fg;
}
- .tip {
+ .tooltip {
fill: @bgBlack;
stroke: @secondary;
stroke-width: 1px;
diff --git a/src/less/modal.less b/src/less/modal.less
index 0742ce3f..c3c2bfc5 100755
--- a/src/less/modal.less
+++ b/src/less/modal.less
@@ -17,7 +17,7 @@
transform:translate(-50%,-50%);
-webkit-transform:translate(-50%,-50%);
width: 800px;
- max-height: 100%;
+ max-height: 90%;
padding: 2em;
background-color: @bgBlack;
box-sizing: border-box;
diff --git a/src/less/outfit.less b/src/less/outfit.less
index 8eff3cf0..8d5e7f0e 100755
--- a/src/less/outfit.less
+++ b/src/less/outfit.less
@@ -235,13 +235,9 @@
font-size: 0.8em;
}
- table tbody tr td {
- &:nth-child(4) {
- span {
- vertical-align: middle;
- font-size: 1.6em;
- }
- }
+ span.btn {
+ vertical-align: middle;
+ font-size: 1.6em;
}
});