diff options
author | bobzel <zzzman@gmail.com> | 2020-08-14 22:22:37 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-14 22:22:37 -0400 |
commit | 5ab3b1b20e4d483a0b3113739a6cb7ef88a9b03c (patch) | |
tree | d59545a5150583208909ad638a1aa30f2afab4db /src/client/views/MainView.tsx | |
parent | 4e3ed774c9ac3d1365c67125ddc97df9de245f41 (diff) |
fixed dragging aliases to remove _stayInColleciton flag. fixed warnings.
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r-- | src/client/views/MainView.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index f7ff895a5..5a9d95aac 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -656,7 +656,11 @@ export class MainView extends React.Component { return !this._flyoutTranslate ? (<div className="mainView-expandFlyoutButton" title="Re-attach sidebar" onPointerDown={MainView.expandFlyout}></div>) : (null); } - addButtonDoc = (doc: Doc | Doc[]) => (doc instanceof Doc ? [doc] : doc).reduce((flg: boolean, doc) => flg && Doc.AddDocToList(Doc.UserDoc().dockedBtns as Doc, "data", doc), true); + addButtonDoc = (doc: Doc | Doc[]) => (doc instanceof Doc ? [doc] : doc).reduce((flg: boolean, doc) => { + const ret = flg && Doc.AddDocToList(Doc.UserDoc().dockedBtns as Doc, "data", doc); + ret && (doc._stayInCollection = undefined); + return ret; + }, true) remButtonDoc = (doc: Doc | Doc[]) => (doc instanceof Doc ? [doc] : doc).reduce((flg: boolean, doc) => flg && Doc.RemoveDocFromList(Doc.UserDoc().dockedBtns as Doc, "data", doc), true); moveButtonDoc = (doc: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (document: Doc | Doc[]) => boolean) => this.remButtonDoc(doc) && addDocument(doc); |