ES6: A few more views

This commit is contained in:
Robin Ward 2014-06-19 12:43:54 -04:00
parent 7d58c43006
commit 194b04917a
6 changed files with 10 additions and 10 deletions

View File

@ -7,7 +7,7 @@
@module Discourse @module Discourse
**/ **/
export default Discourse.Controller.extend({ export default Discourse.Controller.extend({
needs: ['modal', 'topic', 'composerMessages'], needs: ['modal', 'topic', 'composer-messages'],
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY), replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),
checkedMessages: false, checkedMessages: false,
@ -197,7 +197,7 @@ export default Discourse.Controller.extend({
if (this.present('model.reply')) { if (this.present('model.reply')) {
// Notify the composer messages controller that a reply has been typed. Some // Notify the composer messages controller that a reply has been typed. Some
// messages only appear after typing. // messages only appear after typing.
this.get('controllers.composerMessages').typedReply(); this.get('controllers.composer-messages').typedReply();
} }
}, },
@ -219,7 +219,7 @@ export default Discourse.Controller.extend({
if (body.length < Discourse.SiteSettings.min_body_similar_length || if (body.length < Discourse.SiteSettings.min_body_similar_length ||
title.length < Discourse.SiteSettings.min_title_similar_length) { return; } title.length < Discourse.SiteSettings.min_title_similar_length) { return; }
var messageController = this.get('controllers.composerMessages'), var messageController = this.get('controllers.composer-messages'),
similarTopics = this.get('similarTopics'); similarTopics = this.get('similarTopics');
Discourse.Topic.findSimilarTo(title, body).then(function (newTopics) { Discourse.Topic.findSimilarTo(title, body).then(function (newTopics) {
@ -260,7 +260,7 @@ export default Discourse.Controller.extend({
throw "composer opened without a proper draft key"; throw "composer opened without a proper draft key";
} }
var composerMessages = this.get('controllers.composerMessages'), var composerMessages = this.get('controllers.composer-messages'),
self = this, self = this,
composerModel = this.get('model'); composerModel = this.get('model');
@ -327,7 +327,7 @@ export default Discourse.Controller.extend({
this.set('model', composerModel); this.set('model', composerModel);
composerModel.set('composeState', Discourse.Composer.OPEN); composerModel.set('composeState', Discourse.Composer.OPEN);
var composerMessages = this.get('controllers.composerMessages'); var composerMessages = this.get('controllers.composer-messages');
composerMessages.queryFor(composerModel); composerMessages.queryFor(composerModel);
}, },

View File

@ -2,7 +2,7 @@
<div class='contents'> <div class='contents'>
{{render "composerMessages"}} {{render "composer-messages"}}
<div class='control'> <div class='control'>
<a href='#' class='toggler' {{action toggle bubbles=false}} title='{{i18n composer.toggler}}'></a> <a href='#' class='toggler' {{action toggle bubbles=false}} title='{{i18n composer.toggler}}'></a>

View File

@ -93,7 +93,7 @@
{{else}} {{else}}
{{#if postStream.loadedAllPosts}} {{#if postStream.loadedAllPosts}}
{{view Discourse.TopicClosingView topicBinding="model"}} {{view 'topic-closing' topic=model}}
{{view Discourse.TopicFooterButtonsView topicBinding="model"}} {{view Discourse.TopicFooterButtonsView topicBinding="model"}}
{{#if details.suggested_topics.length}} {{#if details.suggested_topics.length}}

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.ComposerMessagesView = Ember.CollectionView.extend({ export default Ember.CollectionView.extend({
classNameBindings: [':composer-popup-container', 'hidden'], classNameBindings: [':composer-popup-container', 'hidden'],
content: Em.computed.alias('controller.content'), content: Em.computed.alias('controller.content'),

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.ShareView = Discourse.View.extend({ export default Discourse.View.extend({
templateName: 'share', templateName: 'share',
elementId: 'share-link', elementId: 'share-link',
classNameBindings: ['hasLink'], classNameBindings: ['hasLink'],

View File

@ -7,7 +7,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.TopicClosingView = Discourse.View.extend({ export default Discourse.View.extend({
elementId: 'topic-closing-info', elementId: 'topic-closing-info',
delayedRerender: null, delayedRerender: null,