FIX: Recursion with a computed property that was pointing to itself.

This commit is contained in:
Robin Ward 2014-06-04 16:33:22 -04:00
parent d46fc79344
commit 411985de3b
4 changed files with 1 additions and 9 deletions

View File

@ -157,10 +157,6 @@ Discourse.Category = Discourse.Model.extend({
return this.countStats('topics'); return this.countStats('topics');
}.property('posts_year', 'posts_month', 'posts_week', 'posts_day'), }.property('posts_year', 'posts_month', 'posts_week', 'posts_day'),
notification_level: function() {
return this.get('notification_level');
}.property('notification_level'),
setNotification: function(notification_level) { setNotification: function(notification_level) {
var url = "/category/" + this.get('id')+"/notifications"; var url = "/category/" + this.get('id')+"/notifications";
this.set('notification_level', notification_level); this.set('notification_level', notification_level);

View File

@ -8,7 +8,7 @@
</ul> </ul>
{{#if canChangeCategoryNotificationLevel}} {{#if canChangeCategoryNotificationLevel}}
{{view Discourse.CategoryNotificationsButton categoryBinding="model" category=category}} {{view Discourse.CategoryNotificationsButton category=category}}
{{/if}} {{/if}}
{{#if canCreateTopic}} {{#if canCreateTopic}}

View File

@ -10,8 +10,6 @@ Discourse.CategoryNotificationsButton = Discourse.NotificationsButton.extend({
classNames: ['notification-options', 'category-notification-menu'], classNames: ['notification-options', 'category-notification-menu'],
buttonIncludesText: false, buttonIncludesText: false,
longDescriptionBinding: null, longDescriptionBinding: null,
category: Em.computed.alias('controller.model'),
target: Em.computed.alias('category'),
hidden: Em.computed.alias('category.deleted'), hidden: Em.computed.alias('category.deleted'),
notificationLevels: Discourse.Category.NotificationLevel, notificationLevels: Discourse.Category.NotificationLevel,
notificationLevel: Em.computed.alias('category.notification_level'), notificationLevel: Em.computed.alias('category.notification_level'),

View File

@ -12,8 +12,6 @@ test("Default List", function() {
test("List one Category", function() { test("List one Category", function() {
expect(2); expect(2);
this.stub(Discourse.User, "current").returns(null);
visit("/category/bug").then(function() { visit("/category/bug").then(function() {
ok(exists("#topic-list"), "The list of topics was rendered"); ok(exists("#topic-list"), "The list of topics was rendered");
ok(exists('#topic-list .topic-list-item'), "has topics"); ok(exists('#topic-list .topic-list-item'), "has topics");