mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #1033 from chrishunt/move-dynamic-favicon-to-user
Move 'dynamic favicon' setting to User preference
This commit is contained in:
@@ -75,7 +75,7 @@ Discourse = Ember.Application.createWithMixins({
|
||||
$('title').text(title);
|
||||
|
||||
var notifyCount = this.get('notifyCount');
|
||||
if (notifyCount > 0 && !Discourse.SiteSettings.dynamic_favicon) {
|
||||
if (notifyCount > 0 && !Discourse.User.current('dynamic_favicon')) {
|
||||
title = "(" + notifyCount + ") " + title;
|
||||
}
|
||||
// chrome bug workaround see: http://stackoverflow.com/questions/2952384/changing-the-window-title-when-focussing-the-window-doesnt-work-in-chrome
|
||||
@@ -86,7 +86,7 @@ Discourse = Ember.Application.createWithMixins({
|
||||
}.observes('title', 'hasFocus', 'notifyCount'),
|
||||
|
||||
faviconChanged: function() {
|
||||
if(Discourse.SiteSettings.dynamic_favicon) {
|
||||
if(Discourse.User.current('dynamic_favicon')) {
|
||||
$.faviconNotify(
|
||||
Discourse.SiteSettings.favicon_url, this.get('notifyCount')
|
||||
);
|
||||
|
||||
@@ -153,6 +153,7 @@ Discourse.User = Discourse.Model.extend({
|
||||
'email_digests',
|
||||
'email_direct',
|
||||
'email_private_messages',
|
||||
'dynamic_favicon',
|
||||
'digest_after_days',
|
||||
'new_topic_duration_minutes',
|
||||
'external_links_in_new_tab',
|
||||
@@ -160,8 +161,12 @@ Discourse.User = Discourse.Model.extend({
|
||||
type: 'PUT'
|
||||
}).then(function(data) {
|
||||
user.set('bio_excerpt',data.user.bio_excerpt);
|
||||
Discourse.User.current().set('enable_quoting', user.get('enable_quoting'));
|
||||
Discourse.User.current().set('external_links_in_new_tab', user.get('external_links_in_new_tab'));
|
||||
|
||||
_.each([
|
||||
'enable_quoting', 'external_links_in_new_tab', 'dynamic_favicon'
|
||||
], function(preference) {
|
||||
Discourse.User.current().set(preference, user.get(preference));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -84,6 +84,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{i18n user.notifications}}</label>
|
||||
<div class="controls">
|
||||
<label>
|
||||
{{view Ember.Checkbox checkedBinding="dynamic_favicon"}}
|
||||
{{i18n user.dynamic_favicon}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group other">
|
||||
<label class="control-label">{{i18n user.other_settings}}</label>
|
||||
<div class="controls">
|
||||
|
||||
Reference in New Issue
Block a user