Skip to content
This repository was archived by the owner on May 10, 2026. It is now read-only.

Commit 83242c2

Browse files
committed
Add display only unread articles button to articles list
closes #155
1 parent 38158a5 commit 83242c2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/scripts/app/views/articleList.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,19 @@ define([
151151
bg.items.on('search', this.handleSearch, this);
152152
bg.sources.on('destroy', this.handleSourcesDestroy, this);
153153
bg.sources.on('clear-events', this.handleClearEvents, this);
154+
bg.settings.on('change', this.onSettingsChange, this);
154155

155156
groups.on('add', this.addGroup, this);
156157

157158
this.on('attach', this.handleAttached, this);
158159
this.on('pick', this.handlePick, this);
159160
},
160161

162+
onSettingsChange: function(){
163+
this.unreadOnly = bg.getBoolean('defaultToUnreadOnly');
164+
this.handleNewSelected(this.currentData);
165+
},
166+
161167
/**
162168
* Sends msg to show selected article
163169
* @method handlePick
@@ -190,7 +196,7 @@ define([
190196
handleAttached: function () {
191197
app.on('select:feed-list', function (data) {
192198
this.el.scrollTop = 0;
193-
this.unreadOnly = data.unreadOnly;
199+
this.unreadOnly = bg.getBoolean('defaultToUnreadOnly');
194200

195201
if (data.action === 'new-select') {
196202
this.handleNewSelected(data);

src/scripts/bgprocess/staticdb/defaultToolbarItems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define([], function () {
88
{
99
version: 1,
1010
region: 'articles',
11-
actions: ['articles:mark', 'articles:update', 'articles:undelete', 'articles:delete', '!dynamicSpace', 'articles:search']
11+
actions: ['articles:mark', 'articles:update', 'articles:undelete', 'articles:delete', '!dynamicSpace', 'articles:toggleShowOnlyUnread', 'articles:search']
1212
},
1313
{
1414
version: 2,

0 commit comments

Comments
 (0)