mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:43:38 +08:00
FIX: display conextual count on favicon if selected
This also corrects the test suite and moves the two notification counts so they are closer together.
This commit is contained in:
parent
b38cf41c65
commit
9bd3afda5d
|
@ -51,12 +51,7 @@ const Discourse = Ember.Application.extend({
|
||||||
$("title").text(title);
|
$("title").text(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
var displayCount =
|
var displayCount = this.get("displayCount");
|
||||||
Discourse.User.current() &&
|
|
||||||
Discourse.User.currentProp("title_count_mode") === "notifications"
|
|
||||||
? this.get("notificationCount")
|
|
||||||
: this.get("contextCount");
|
|
||||||
|
|
||||||
if (displayCount > 0 && !Discourse.User.currentProp("dynamic_favicon")) {
|
if (displayCount > 0 && !Discourse.User.currentProp("dynamic_favicon")) {
|
||||||
title = `(${displayCount}) ${title}`;
|
title = `(${displayCount}) ${title}`;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +59,14 @@ const Discourse = Ember.Application.extend({
|
||||||
document.title = title;
|
document.title = title;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed("contextCount", "notificationCount")
|
||||||
|
displayCount() {
|
||||||
|
return Discourse.User.current() &&
|
||||||
|
Discourse.User.currentProp("title_count_mode") === "notifications"
|
||||||
|
? this.get("notificationCount")
|
||||||
|
: this.get("contextCount");
|
||||||
|
},
|
||||||
|
|
||||||
@observes("contextCount", "notificationCount")
|
@observes("contextCount", "notificationCount")
|
||||||
faviconChanged() {
|
faviconChanged() {
|
||||||
if (Discourse.User.currentProp("dynamic_favicon")) {
|
if (Discourse.User.currentProp("dynamic_favicon")) {
|
||||||
|
@ -76,9 +79,7 @@ const Discourse = Ember.Application.extend({
|
||||||
url = Discourse.getURL("/favicon/proxied?" + encodeURIComponent(url));
|
url = Discourse.getURL("/favicon/proxied?" + encodeURIComponent(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
var displayCount = Discourse.User.current()
|
var displayCount = this.get("displayCount");
|
||||||
? this.get("notificationCount")
|
|
||||||
: this.get("contextCount");
|
|
||||||
|
|
||||||
new window.Favcount(url).set(displayCount);
|
new window.Favcount(url).set(displayCount);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
|
|
||||||
{{preference-checkbox labelKey="user.external_links_in_new_tab" checked=model.user_option.external_links_in_new_tab}}
|
{{preference-checkbox labelKey="user.external_links_in_new_tab" checked=model.user_option.external_links_in_new_tab}}
|
||||||
{{preference-checkbox labelKey="user.enable_quoting" checked=model.user_option.enable_quoting}}
|
{{preference-checkbox labelKey="user.enable_quoting" checked=model.user_option.enable_quoting}}
|
||||||
{{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}}
|
|
||||||
{{#if siteSettings.automatically_unpin_topics}}
|
{{#if siteSettings.automatically_unpin_topics}}
|
||||||
{{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}}
|
{{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -57,6 +56,7 @@
|
||||||
{{#if isiPad}}
|
{{#if isiPad}}
|
||||||
{{preference-checkbox labelKey="user.enable_physical_keyboard" checked=disableSafariHacks}}
|
{{preference-checkbox labelKey="user.enable_physical_keyboard" checked=disableSafariHacks}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}}
|
||||||
<div class='controls controls-dropdown'>
|
<div class='controls controls-dropdown'>
|
||||||
<label for="user-email-level">{{i18n 'user.title_count_mode.title'}}</label>
|
<label for="user-email-level">{{i18n 'user.title_count_mode.title'}}</label>
|
||||||
{{combo-box valueAttribute="value"
|
{{combo-box valueAttribute="value"
|
||||||
|
|
|
@ -772,7 +772,7 @@ en:
|
||||||
dismiss_notifications: "Dismiss All"
|
dismiss_notifications: "Dismiss All"
|
||||||
dismiss_notifications_tooltip: "Mark all unread notifications as read"
|
dismiss_notifications_tooltip: "Mark all unread notifications as read"
|
||||||
first_notification: "Your first notification! Select it to begin."
|
first_notification: "Your first notification! Select it to begin."
|
||||||
dynamic_favicon: "Show new / updated topic count on browser icon"
|
dynamic_favicon: "Show counts on browser icon"
|
||||||
theme_default_on_all_devices: "Make this the default theme on all my devices"
|
theme_default_on_all_devices: "Make this the default theme on all my devices"
|
||||||
text_size_default_on_all_devices: "Make this the default text size on all my devices"
|
text_size_default_on_all_devices: "Make this the default text size on all my devices"
|
||||||
allow_private_messages: "Allow other users to send me personal messages"
|
allow_private_messages: "Allow other users to send me personal messages"
|
||||||
|
|
|
@ -26,7 +26,8 @@ export default {
|
||||||
custom_fields: {},
|
custom_fields: {},
|
||||||
muted_category_ids: [],
|
muted_category_ids: [],
|
||||||
dismissed_banner_key: null,
|
dismissed_banner_key: null,
|
||||||
akismet_review_count: 0
|
akismet_review_count: 0,
|
||||||
|
title_count_mode: "notifications"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user