Skip to content

Commit b453327

Browse files
committed
.
1 parent 7125133 commit b453327

6 files changed

Lines changed: 33 additions & 21 deletions

File tree

flex2.idea

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ logo
2323
analytics
2424
read file sync for callback
2525
submissions->utilities
26+
27+
04:43:53 <%Lil-G> i mean so when you do "delete unused tiles" it doesn't delete the tiles the other object uses

modules/components/documentation/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { A } from './a.js';
44

55
function semvarToInt(str) {
66
// currently just a rough calculation
7-
return +str.split`.`.map((d) => d.padStart(3, '0')).join``;
7+
return +str.replace(/[^\d.]/g,'').split`.`.map((d) => d.padStart(3, '0')).join``;
88
}
99

1010
export class Version extends Component {

modules/components/project/object.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,26 @@ const paletteLengths = '1234'.split``.map((d) => ({label: d, value: +d}));
1313
@observer
1414
export class ObjectConfig extends Component {
1515

16-
state = { open: false, confirmDelete: false };
16+
state = { open: false, confirmDelete: false, loading: false, saving: false };
1717
mounted = true;
1818

19+
load = () => {
20+
this.setState({loading: true});
21+
requestIdleCallback(() => {
22+
this.props.obj.load(() => {
23+
this.setState({loading: false});
24+
});
25+
});
26+
};
27+
save = () => {
28+
this.setState({saving: true});
29+
requestIdleCallback(() => {
30+
this.props.obj.save(() => {
31+
this.setState({saving: false});
32+
});
33+
});
34+
};
35+
1936
onToggle = () => {
2037
this.setState({open: !this.state.open});
2138
}
@@ -40,7 +57,7 @@ export class ObjectConfig extends Component {
4057

4158
render() {
4259
const { obj } = this.props;
43-
const { open, confirmDelete } = this.state;
60+
const { open, confirmDelete, loading, saving } = this.state;
4461

4562
return <div>
4663
<div className="row object-header">
@@ -57,11 +74,11 @@ export class ObjectConfig extends Component {
5774
<Item inverted color="blue" onClick={this.onToggle}>
5875
{open ? 'Hide Config' : 'Show Config'}
5976
</Item>
60-
<Item color="green" inverted onClick={obj.load}>
61-
Load Data
77+
<Item color="green" inverted onClick={this.load}>
78+
{loading ? 'Loading...' : 'Load Data'}
6279
</Item>
63-
<Item color="orange" inverted onClick={obj.save}>
64-
Save Data
80+
<Item color="orange" inverted onClick={this.save}>
81+
{saving ? 'Saving...' : 'Save Data'}
6582
</Item>
6683
</div>
6784
</div>

modules/root.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@ render(
1313
document.addEventListener('dragover', (e) => {
1414
e.preventDefault();
1515
return false;
16-
},false);
16+
}, false);
1717

1818
document.addEventListener('drop', (e) => {
1919
e.preventDefault();
2020
return false;
21-
},false);
22-
23-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
24-
(i[r].q=i[r].q||[]).push(arguments);},i[r].l=1*new Date();a=s.createElement(o),
25-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m);
26-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
27-
28-
ga('create', 'UA-109339588-1', 'auto');
29-
ga('send', 'pageview');
21+
}, false);

modules/store/environment.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFile, readFileSync, writeFile } from 'fs';
1+
import { readFileSync, writeFile } from 'fs';
22
import { extname } from 'path';
33
import { observable, computed, action, autorun, toJS, spy } from 'mobx';
44
import range from 'lodash/range';
@@ -163,7 +163,6 @@ class Environment {
163163
} catch(e) {
164164
errorMsg('Error Reading DPLC File', e.message);
165165
}
166-
167166
};
168167

169168
@action saveObject = (obj) => {

modules/store/objectdef.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ export class ObjectDef {
6666
this.parent = parent;
6767
}
6868

69-
@action load = () => {
69+
@action load = (callback) => {
7070
environment.loadObject(this);
71+
callback();
7172
};
7273

73-
@action save = () => {
74+
@action save = (callback) => {
7475
environment.saveObject(this);
76+
callback();
7577
};
7678

7779
@action remove = () => {

0 commit comments

Comments
 (0)