aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-05-16 18:32:57 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-05-16 18:32:57 -0400
commitb29a0d1cef60b55f609fcd94ad38232ae557e681 (patch)
tree3b2cf48d0ac27582da8603ca7f614b68f874ab0c /src/client/views/DocumentDecorations.tsx
parent179200777d8d283509bc81ea1318c1f51c2251ce (diff)
Fixed linter errors
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index b2c65a31f..7083b1003 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -250,22 +250,21 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
selectedDocs[0].props.removeDocument && selectedDocs[0].props.removeDocument(this._iconDoc);
}
if (!this._removeIcon) {
- if (selectedDocs.length === 1)
+ if (selectedDocs.length === 1) {
this.getIconDoc(selectedDocs[0]).then(icon => selectedDocs[0].props.toggleMinimized());
- else
- if (Math.abs(e.pageX - this._downX) < Utils.DRAG_THRESHOLD &&
- Math.abs(e.pageY - this._downY) < Utils.DRAG_THRESHOLD) {
- let docViews = SelectionManager.ViewsSortedVertically();
- let topDocView = docViews[0];
- let ind = topDocView.templates.indexOf(Templates.Bullet.Layout);
- if (ind !== -1) {
- topDocView.templates.splice(ind, 1);
- topDocView.props.Document.subBulletDocs = undefined;
- } else {
- topDocView.addTemplate(Templates.Bullet);
- topDocView.props.Document.subBulletDocs = new List<Doc>(docViews.filter(v => v !== topDocView).map(v => v.props.Document.proto!));
- }
+ } else if (Math.abs(e.pageX - this._downX) < Utils.DRAG_THRESHOLD &&
+ Math.abs(e.pageY - this._downY) < Utils.DRAG_THRESHOLD) {
+ let docViews = SelectionManager.ViewsSortedVertically();
+ let topDocView = docViews[0];
+ let ind = topDocView.templates.indexOf(Templates.Bullet.Layout);
+ if (ind !== -1) {
+ topDocView.templates.splice(ind, 1);
+ topDocView.props.Document.subBulletDocs = undefined;
+ } else {
+ topDocView.addTemplate(Templates.Bullet);
+ topDocView.props.Document.subBulletDocs = new List<Doc>(docViews.filter(v => v !== topDocView).map(v => v.props.Document.proto!));
}
+ }
}
this._removeIcon = false;
}
@@ -537,9 +536,9 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
if (temp !== Templates.Bullet.Layout || i === 0) {
res.push(temp);
}
- })
+ });
}
- return res
+ return res;
}, [] as string[]);
let checked = false;
docTemps.forEach(temp => {