mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49a6c5f2c4 | ||
|
|
298eaa8b4b | ||
|
|
7b87038a8c | ||
|
|
fdc9171c69 | ||
|
|
f43bd100e6 | ||
|
|
fbba0e3ea5 | ||
|
|
b15695128f | ||
|
|
0870b90443 | ||
|
|
48ccab152b | ||
|
|
f3bc900f16 | ||
|
|
ec148847a9 | ||
|
|
0474af912a |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "2.9.15",
|
||||
"version": "2.9.14",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "2.9.15",
|
||||
"version": "2.9.14",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EDCD/coriolis"
|
||||
|
||||
@@ -355,8 +355,6 @@ export default class Coriolis extends React.Component {
|
||||
<footer>
|
||||
<div className="right cap">
|
||||
<a href="https://github.com/EDCD/coriolis" target="_blank" title="Coriolis Github Project">{window.CORIOLIS_VERSION} - {window.CORIOLIS_DATE}</a>
|
||||
<br/>
|
||||
<a href={"https://github.com/EDCD/coriolis/compare/edcd:develop@{" + window.CORIOLIS_DATE + "}...edcd:develop"} target="_blank" title={"Coriolis Commits since" + window.CORIOLIS_DATE}>Commits since last release ({window.CORIOLIS_DATE})</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>;
|
||||
|
||||
@@ -107,7 +107,6 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
warning: PropTypes.func,
|
||||
firstSlotId: PropTypes.string,
|
||||
lastSlotId: PropTypes.string,
|
||||
activeSlotId: PropTypes.string,
|
||||
slotDiv: PropTypes.object
|
||||
};
|
||||
|
||||
@@ -256,7 +255,11 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
});
|
||||
let eventHandlers;
|
||||
|
||||
if (disabled) {
|
||||
if (disabled || active) {
|
||||
/**
|
||||
* ToDo: possibly create an "activeSlotId" variable to allow
|
||||
* focus to be set on active slot when slot menu is opened
|
||||
*/
|
||||
eventHandlers = {
|
||||
onKeyDown: this._keyDown.bind(this, null),
|
||||
onKeyUp: this._keyUp.bind(this, null)
|
||||
@@ -268,7 +271,6 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
* Will be used to keep focus inside the <ul> on Tab and Shift-Tab while it is visible
|
||||
*/
|
||||
if (this.firstSlotId == null) this.firstSlotId = sortedModules[i].id;
|
||||
if (active) this.activeSlotId = sortedModules[i].id;
|
||||
this.lastSlotId = sortedModules[i].id;
|
||||
|
||||
let showDiff = this._showDiff.bind(this, mountedModule, m);
|
||||
@@ -298,8 +300,8 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
elems.push(<br key={'b' + m.grp + i} />);
|
||||
itemsOnThisRow = 0;
|
||||
}
|
||||
let tbIdx = (classes.indexOf('disabled') < 0) ? 0 : undefined;
|
||||
elems.push(
|
||||
let tbIdx = (classes.indexOf('disabled') < 0 && classes.indexOf('active') < 0) ? 0 : undefined;
|
||||
elems.push(
|
||||
<li key={m.id} data-id={m.id} className={classes} {...eventHandlers} tabIndex={tbIdx} ref={slotItem => this.slotItems[m.id] = slotItem}>
|
||||
{mount}
|
||||
{(mount ? ' ' : '') + m.class + m.rating + (m.missile ? '/' + m.missile : '') + (m.name ? ' ' + translate(m.name) : '')}
|
||||
@@ -370,7 +372,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
|
||||
_keyDown(select, event) {
|
||||
var className = event.currentTarget.attributes['class'].value;
|
||||
if (event.key == 'Enter' && className.indexOf('disabled') < 0 && className.indexOf('active') < 0) {
|
||||
if (event.key == 'Enter' && className.indexOf('disabled') < 0 && className.indexOf('active') < 0) {
|
||||
select();
|
||||
return
|
||||
}
|
||||
@@ -450,26 +452,28 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
/**
|
||||
* Scroll to mounted (if it exists) module group on mount
|
||||
*/
|
||||
|
||||
componentDidMount() {
|
||||
if (this.groupElem) { // Scroll to currently selected group
|
||||
this.node.scrollTop = this.groupElem.offsetTop;
|
||||
}
|
||||
/**
|
||||
* Set focus on active or first slot element, if applicable.
|
||||
*/
|
||||
if (this.slotItems[this.activeSlotId]) {
|
||||
this.slotItems[this.activeSlotId].focus();
|
||||
} else if (this.slotItems[this.firstSlotId]) {
|
||||
|
||||
if (this.slotItems) {
|
||||
/**
|
||||
* Set focus on first focusable slot <li> after component mounts. May want to consider
|
||||
* changing this to the Active item instead.
|
||||
*/
|
||||
this.slotItems[this.firstSlotId].focus();
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
/**
|
||||
* Set focus to slot element ref (if we have one) after modules component unmounts
|
||||
*/
|
||||
|
||||
if(this.props.slotDiv) {
|
||||
console.log("AvailableModulesMenu component will unmount. Set focus to slot");
|
||||
this.props.slotDiv.focus();
|
||||
} else {
|
||||
console.log("AvailableModulesMenu component will unmount. No slotDiv prop present.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -505,9 +505,6 @@ export default class Header extends TranslatedComponent {
|
||||
return (
|
||||
<header>
|
||||
{this.props.appCacheUpdate && <div id="app-update" onClick={() => window.location.reload() }>{translate('PHRASE_UPDATE_RDY')}</div>}
|
||||
{this.props.appCache ? <a className={"view-changes"} href={"https://github.com/EDCD/coriolis/compare/edcd:develop@{" + window.CORIOLIS_DATE + "}...edcd:develop"} target="_blank">
|
||||
{"View Release Changes"}
|
||||
</a> : null}
|
||||
<Link className='l' href='/' style={{ marginRight: '1em' }} title='Home'><CoriolisLogo className='icon xl' /></Link>
|
||||
|
||||
<div className='l menu'>
|
||||
|
||||
@@ -407,11 +407,6 @@ export default class ModificationsMenu extends TranslatedComponent {
|
||||
let haveBlueprint = false;
|
||||
let blueprintTt;
|
||||
let blueprintCv;
|
||||
//TODO: Fix this to actually find the correct blueprint.
|
||||
if (!m.blueprint || !m.blueprint.name || !m.blueprint.fdname || !Modifications.modules[m.grp].blueprints || !Modifications.modules[m.grp].blueprints[m.blueprint.fdname]) {
|
||||
this.props.ship.clearModuleBlueprint(m);
|
||||
this.props.ship.clearModuleSpecial(m);
|
||||
}
|
||||
if (m.blueprint && m.blueprint.name && Modifications.modules[m.grp].blueprints[m.blueprint.fdname].grades[m.blueprint.grade]) {
|
||||
blueprintLabel = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade;
|
||||
haveBlueprint = true;
|
||||
|
||||
@@ -437,15 +437,12 @@ export default class Ship {
|
||||
m.blueprint = bp;
|
||||
this.clearModifications(m);
|
||||
// Set any hidden items for the blueprint now
|
||||
if (m.blueprint.grades[m.blueprint.grade] && m.blueprint.grades[m.blueprint.grade].features) {
|
||||
const features = m.blueprint.grades[m.blueprint.grade].features;
|
||||
for (const featureName in features) {
|
||||
if (Modifications.modifications[featureName].hidden) {
|
||||
this.setModification(m, featureName, bp.grades[bp.grade].features[featureName][0]);
|
||||
}
|
||||
const features = m.blueprint.grades[m.blueprint.grade].features;
|
||||
for (const featureName in features) {
|
||||
if (Modifications.modifications[featureName].hidden) {
|
||||
this.setModification(m, featureName, bp.grades[bp.grade].features[featureName][0]);
|
||||
}
|
||||
}
|
||||
|
||||
this.updateModificationsString();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,20 +12,6 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.view-changes {
|
||||
position: fixed;
|
||||
top: 3em;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3em;
|
||||
z-index: 3;
|
||||
line-height: 3em;
|
||||
text-align: center;
|
||||
background-color: @bg;
|
||||
color: @warning;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
header {
|
||||
background-color: @bg;
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user