mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Much improved folder highlighting, taking into account selections deep in a subtree.
This commit is contained in:
parent
8644c6ae48
commit
f10406bf28
3 changed files with 32 additions and 6 deletions
|
@ -10829,6 +10829,12 @@ form.opml_import_form input {
|
|||
border: 1px solid rgba(0, 0, 0, .2);
|
||||
margin: 4px 24px 0 0;
|
||||
clear: both;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.NB-modal-organizer .NB-feedlist .feed_title {
|
||||
padding-right: 186px;
|
||||
|
|
|
@ -101,11 +101,6 @@ _.extend(NEWSBLUR.ReaderOrganizer.prototype, {
|
|||
|
||||
// Make sure all folders are visible
|
||||
$('.NB-folder.NB-hidden', $feeds).removeClass('NB-hidden');
|
||||
|
||||
$('.unread_count_positive', $feeds).text('');
|
||||
$('.unread_count_negative', $feeds).text('');
|
||||
|
||||
$('.selected', $feeds).removeClass('selected');
|
||||
|
||||
NEWSBLUR.Collections.Folders.organizer_sortorder = null;
|
||||
NEWSBLUR.assets.folders.sort();
|
||||
|
|
|
@ -394,7 +394,20 @@ NEWSBLUR.Views.Folder = Backbone.View.extend({
|
|||
var folder_title = this.options.folder_title;
|
||||
var all_children_highlighted = this.collection.all(function(item) {
|
||||
if (item.is_feed()) {
|
||||
var view = _.detect(item.feed.views, function(view) {
|
||||
if (view.options.feed_chooser &&
|
||||
view.options.folder_title == folder_title) {
|
||||
return view;
|
||||
}
|
||||
});
|
||||
|
||||
if (!view) return true;
|
||||
|
||||
return item.feed.highlighted_in_folder(folder_title);
|
||||
} else if (item.is_folder()) {
|
||||
return _.all(item.folder_views, function(view) {
|
||||
return view.all_children_highlighted();
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
@ -402,9 +415,13 @@ NEWSBLUR.Views.Folder = Backbone.View.extend({
|
|||
return all_children_highlighted;
|
||||
},
|
||||
|
||||
highlight_feeds: function() {
|
||||
highlight_feeds: function(options) {
|
||||
options = options || {};
|
||||
if (!this.options.feed_chooser) return;
|
||||
var $folder = options.currentTarget && $(options.currentTarget).closest('li.folder');
|
||||
if ($folder && $folder[0] != this.el) return;
|
||||
var all_children_highlighted = this.all_children_highlighted();
|
||||
if (options.force_highlight) all_children_highlighted = false;
|
||||
var folder_title = this.options.folder_title;
|
||||
|
||||
this.collection.each(function(item) {
|
||||
|
@ -423,6 +440,14 @@ NEWSBLUR.Views.Folder = Backbone.View.extend({
|
|||
} else {
|
||||
view.highlight(true, false);
|
||||
}
|
||||
} else if (item.is_folder()) {
|
||||
_.each(item.folder_views, function(view) {
|
||||
if (!all_children_highlighted) {
|
||||
view.highlight_feeds({force_highlight: true});
|
||||
} else {
|
||||
view.highlight_feeds();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue