Fixing feed chooser dropdown on dialogs, specifically the Statistics dialog.

This commit is contained in:
Samuel Clay 2021-04-27 20:12:58 -04:00
parent b89b599ae9
commit c32830faf9
3 changed files with 8 additions and 4 deletions

View file

@ -68,7 +68,7 @@ backend node_images
option httpchk HEAD /sc,sN1megONJiGNy-CCvqzVPTv-TWRhgSKhFlf61XAYESl4=/http:/samuelclay.com/static/images/2019%20-%20Cuba.jpg
http-check expect rstatus 200|301
http-request replace-path /imageproxy(.*) \1
server node_images imageproxy:8088 check inter 2000ms
server node_images imageproxy:8088 check inter 600000ms
backend node_socket
http-check expect rstatus 200|503

View file

@ -44,7 +44,7 @@ _.extend(NEWSBLUR.ReaderStatistics.prototype, {
this.$modal = $.make('div', { className: 'NB-modal-statistics NB-modal' }, [
(!this.options.embedded && $.make('div', { className: 'NB-modal-feed-chooser-container'}, [
this.make_feed_chooser({skip_starred: true})
this.make_feed_chooser({skip_starred: true, feed_id: this.feed.id})
])),
$.make('div', { className: 'NB-modal-loading' }),
(!this.options.embedded && $.make('h2', { className: 'NB-modal-title' }, 'Statistics & History')),

View file

@ -162,7 +162,8 @@ NEWSBLUR.utils = {
var $saved_searches_optgroup = $.make('optgroup', { label: "Saved Searches" });
var $starred_feeds_optgroup = $.make('optgroup', { label: "Saved Tags" });
var current_feed_id = options.feed_id;
var selected_feed_prefix = '';
var make_feed_option = function(feed) {
if (!feed.get('feed_title')) return;
if (!feed.get('active')) return;
@ -177,7 +178,10 @@ NEWSBLUR.utils = {
$feeds_optgroup);
if (feed.id == current_feed_id) {
// console.log('Selecting feed id in feed chooser', feed, current_feed_id);
$option.attr('selected', true);
$chooser.val(prefix + feed.id);
selected_feed_prefix = prefix;
}
};
@ -227,7 +231,7 @@ NEWSBLUR.utils = {
}
if (options.feed_id) {
$chooser.val(options.feed_id);
$chooser.val(selected_feed_prefix + options.feed_id);
}
return $chooser;