Skip to content

Commit 82d2126

Browse files
committed
Fixed issues before first release
1 parent feb37c5 commit 82d2126

File tree

5 files changed

+37
-35
lines changed

5 files changed

+37
-35
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ using it. Please open a ticket in tracker to notify me :) I'll appreciate.
66

77
## Knowns issues
88

9-
* Closing and minimizing window are not working on Windows
109
* Troubles with menu animations
10+
* Import/export functions are experimental
1111

1212
## Future improvements
1313

1414
* Exporting to browser
1515
* Creating a backup from app
1616
* A reset feature
17-
* Improving design
17+
* Improving design
18+
* Social network sharing

app/presenters/MainPresenter/BookmarkList.ts

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BookmarkList {
1010

1111
private _defaultContent : DOMElement;
1212
private _isDefaultContentCurrent : boolean;
13-
private _isPressingMetaKey : boolean;
13+
private _keyboardEventObj : DOMElementEventObject;
1414

1515
//endregion Fields
1616

@@ -22,21 +22,24 @@ class BookmarkList {
2222
this._destList = this._wrapper.findSingle('.js-bookmark-list');
2323
this._defaultContent = this._wrapper.findSingle('.js-default-content');
2424
this._isDefaultContentCurrent = false;
25-
this._isPressingMetaKey = false;
2625

27-
DOMTree.getDocument().on(
28-
DOMElementEvents.KeyDown,
29-
(e) => {
30-
this._isPressingMetaKey = e.isMetaKey();
31-
}
32-
);
26+
DOMTree
27+
.getDocument()
28+
.on(
29+
DOMElementEvents.KeyDown,
30+
(e) => {
31+
this._keyboardEventObj = e;
32+
}
33+
);
3334

34-
DOMTree.getDocument().on(
35-
DOMElementEvents.KeyUp,
36-
(e) => {
37-
this._isPressingMetaKey = false;
38-
}
39-
);
35+
DOMTree
36+
.getDocument()
37+
.on(
38+
DOMElementEvents.KeyUp,
39+
(e) => {
40+
this._keyboardEventObj = null;
41+
}
42+
);
4043
}
4144

4245
//endregion Constructors
@@ -105,16 +108,18 @@ class BookmarkList {
105108
e.on(
106109
DOMElementEvents.Click,
107110
(arg) => {
108-
if (this._isPressingMetaKey) {
109-
BookmarkDAO.find(
110-
e.getData('id'),
111-
(outcome) => {
112-
outcome.setViews(outcome.getViews() + 1);
113-
outcome.update();
114-
NodeWindow.openExternal(outcome.getURL());
115-
}
116-
);
117-
this._isPressingMetaKey = false;
111+
if (TSObject.exists(this._keyboardEventObj)) {
112+
if (this._keyboardEventObj.getWhich() === 17
113+
|| this._keyboardEventObj.isMetaKey()) {
114+
BookmarkDAO.find(
115+
e.getData('id'),
116+
(outcome) => {
117+
outcome.setViews(outcome.getViews() + 1);
118+
outcome.update();
119+
NodeWindow.openExternal(outcome.getURL());
120+
}
121+
);
122+
}
118123
} else {
119124
this._subscriber.onBookmarkSelection(e.getData('id'));
120125
}
@@ -236,10 +241,6 @@ class BookmarkList {
236241
);
237242
}
238243

239-
unfocus() : void {
240-
this._isPressingMetaKey = false;
241-
}
242-
243244
//endregion Public Methods
244245

245246
//endregion Methods

app/presenters/MainPresenter/MainPresenter.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ class MainPresenter
183183
this._tagList.resetList(() => this._tagList.selectMostPopular());
184184
this._bookmarkList.displayMostPopular();
185185
}
186-
187-
onPause() : void {
188-
this._bookmarkList.unfocus();
189-
}
190-
186+
191187
//region IBookmarkFormSubscriber
192188

193189
onBookmarkCancellation() : void {

app/ui/assets/scss/_common.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ a {
7171
img {
7272
opacity : 1;
7373

74+
-webkit-app-region: no-drag;
75+
7476
@include transition(opacity, 0.5s, ease);
7577

7678
&:hover {

app/ui/assets/scss/main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ $green : #7EB530;
337337
background-color : $black;
338338

339339
.bookmark-icon {
340+
width : 16;
341+
340342
cursor : pointer;
341343
}
342344

0 commit comments

Comments
 (0)