minimized button and bugfix

This commit is contained in:
Catrin 2014-05-05 14:47:27 +02:00 committed by Neil Lalonde
parent 5f8ac51059
commit 5726f6f040
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<div>
<button class='btn standard dropdown-toggle' data-toggle='dropdown'>
<i {{bind-attr class=view.icon}}"></i>&nbsp;{{view.text}}
<i {{bind-attr class=view.icon}}"></i>
<span class='caret'></span>
</button>

View File

@ -12,6 +12,11 @@ Discourse.CategoryNotificationsButton = Discourse.View.extend({
hidden: Em.computed.alias('category.deleted'),
templateName: 'category_notification_dropdown',
init: function() {
this.display();
this._super();
},
dropDownContent: function() {
var contents = [];
@ -22,8 +27,6 @@ Discourse.CategoryNotificationsButton = Discourse.View.extend({
['MUTED', 'muted']
], function(pair) {
if (pair[1] === 'regular') { return; }
contents.push({
id: Discourse.Category.NotificationLevel[pair[0]],
title: I18n.t('category.notifications.' + pair[1] + '.title'),
@ -39,7 +42,7 @@ Discourse.CategoryNotificationsButton = Discourse.View.extend({
// displayed Button
display: function() {
var key = (function() {
switch (this.get('category.notification_level')) {
switch (this.get('category').notification_level) {
case Discourse.Category.NotificationLevel.WATCHING: return 'watching';
case Discourse.Category.NotificationLevel.TRACKING: return 'tracking';
case Discourse.Category.NotificationLevel.MUTED: return 'muted';
@ -52,10 +55,10 @@ Discourse.CategoryNotificationsButton = Discourse.View.extend({
case 'watching': return 'fa fa-circle heatmap-high';
case 'tracking': return 'fa fa-circle heatmap-low';
case 'muted': return 'fa fa-times-circle';
default: return '';
default: return 'fa fa-circle-o';
}
})();
this.set("text", I18n.t("category.notifications." + key + ".title"));
this.set("icon", icon);
},