Skip to content

Commit 0733d06

Browse files
committed
fixed layer title overflow issues and blank updated timestamp on new styles
1 parent 8e32431 commit 0733d06

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

src/model/Mstyle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const Mstyle = {
3232
}
3333
}
3434
];
35+
const now = new Date().getTime();
36+
style._store = {
37+
updated:now
38+
};
3539
LocalStorage.set(style.id,style);
3640

3741
Store.dispatch({

src/reducer/Rstyles.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default function(state = iState, action){
2020
}
2121
case 'STYLE_ADD':{
2222
const add = fromJS(action.payload);
23-
console.log('style add:',add);
2423
return state.setIn(['recs',action.payload.id],add);
2524
}
2625
case 'STYLE_REMOVE':{

src/view/Vlayer/VlayerEdit.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ export default class VlayerEdit extends React.Component {
9090
{this.state.editId?
9191
<VlayerEditId handle={{change:this.handle.changeId}} style={style} error={layerError} layer={layer}/>
9292
:
93-
<h2 className="px-2 py-1 m-0 text-nav bg-light">
94-
{layer.get('id')}
95-
<div className="float-right">
93+
<h2 className="px-2 py-1 m-0 text-nav bg-light row">
94+
<div className="text-overflow-ellipsis flex-2">
95+
{layer.get('id')}
96+
</div>
97+
<div className="text-right">
9698
<div onClick={this.handle.clickEdit} className={'d-inline-block layer-nav-link px-1 '+(this.state.mode === 'edit' ? 'active': '')}>
9799
<i className="material-icons md-18 icon-btn gray">mode_edit</i>
98100
</div>

src/view/Vlayer/index.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default class Vlayers extends React.Component {
8282
const layers = style.get('layers');
8383

8484
return <div className="row mr-0 h-100">
85-
<div className="col-sm-5 pr-0">
85+
<div className="col-5 pr-0">
8686
<div className="pl-1 py-1">
8787
{this.state.searchShow ?
8888
<div className="px-2 py-1 m-0 text-nav bg-light list-border-right clearfix position-relative">
@@ -107,9 +107,11 @@ export default class Vlayers extends React.Component {
107107
</div>
108108
</div>
109109
:
110-
<h2 className="px-2 py-1 m-0 text-nav bg-light list-border-right">
111-
Layers ({layers.size})
112-
<div className="float-right">
110+
<h2 className="px-2 py-1 m-0 text-nav bg-light list-border-right row">
111+
<div className="flex-2 text-overflow-ellipsis">
112+
Layers ({layers.size})
113+
</div>
114+
<div className="">
113115
<span className="icon-btn gray" onClick={this.handle.searchShow}>
114116
<i className="material-icons md-18">search</i>
115117
</span>
@@ -164,7 +166,7 @@ export default class Vlayers extends React.Component {
164166
</div>
165167
</div>
166168
</div>
167-
<div className="col-sm-7 px-0">
169+
<div className="col-7 px-0">
168170
<div className="p-1">
169171
<Switch>
170172
<Route path={`${match.url}/add`}

src/view/Vstyles/VstyleAdd.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class VstyleAdd extends React.Component {
6464

6565
var reader = new FileReader();
6666
reader.onloadend = (e)=>{
67-
console.log('text:',e.target.result);
67+
//console.log('text:',e.target.result);
6868
const text = e.target.result;
6969
let json;
7070
try {
@@ -74,7 +74,7 @@ export default class VstyleAdd extends React.Component {
7474
}
7575
Mstyle.add(json).then((style)=>{
7676
handle.route('style/'+style.id);
77-
MstyleSource.setStyleSourceJSON(style);
77+
//MstyleSource.setStyleSourceJSON(style);
7878
}).catch((e)=>{
7979
this.setState({error:e});
8080
console.error(e);

0 commit comments

Comments
 (0)