mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Hack to allow posts to have access to siteSettings
This commit is contained in:
@@ -11,6 +11,12 @@ const Post = RestModel.extend({
|
|||||||
this.set('replyHistory', []);
|
this.set('replyHistory', []);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed()
|
||||||
|
siteSettings() {
|
||||||
|
// TODO: Remove this once one instantiate all `Discourse.Post` models via the store.
|
||||||
|
return Discourse.SiteSettings;
|
||||||
|
},
|
||||||
|
|
||||||
shareUrl: function() {
|
shareUrl: function() {
|
||||||
const user = Discourse.User.current();
|
const user = Discourse.User.current();
|
||||||
const userSuffix = user ? '?u=' + user.get('username_lower') : '';
|
const userSuffix = user ? '?u=' + user.get('username_lower') : '';
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
/*eslint no-bitwise:0 */
|
/*eslint no-bitwise:0 */
|
||||||
import CloakedView from 'discourse/views/cloaked';
|
|
||||||
|
|
||||||
const CloakedCollectionView = Ember.CollectionView.extend({
|
const CloakedCollectionView = Ember.CollectionView.extend({
|
||||||
cloakView: Ember.computed.alias('itemViewClass'),
|
cloakView: Ember.computed.alias('itemViewClass'),
|
||||||
topVisible: null,
|
topVisible: null,
|
||||||
@@ -10,7 +8,7 @@ const CloakedCollectionView = Ember.CollectionView.extend({
|
|||||||
loadingHTML: 'Loading...',
|
loadingHTML: 'Loading...',
|
||||||
scrollDebounce: 10,
|
scrollDebounce: 10,
|
||||||
|
|
||||||
init: function() {
|
init() {
|
||||||
const cloakView = this.get('cloakView'),
|
const cloakView = this.get('cloakView'),
|
||||||
idProperty = this.get('idProperty'),
|
idProperty = this.get('idProperty'),
|
||||||
uncloakDefault = !!this.get('uncloakDefault');
|
uncloakDefault = !!this.get('uncloakDefault');
|
||||||
@@ -19,6 +17,7 @@ const CloakedCollectionView = Ember.CollectionView.extend({
|
|||||||
const slackRatio = parseFloat(this.get('slackRatio'));
|
const slackRatio = parseFloat(this.get('slackRatio'));
|
||||||
if (!slackRatio) { this.set('slackRatio', 1.0); }
|
if (!slackRatio) { this.set('slackRatio', 1.0); }
|
||||||
|
|
||||||
|
const CloakedView = this.container.lookupFactory('view:cloaked');
|
||||||
this.set('itemViewClass', CloakedView.extend({
|
this.set('itemViewClass', CloakedView.extend({
|
||||||
classNames: [cloakView + '-cloak'],
|
classNames: [cloakView + '-cloak'],
|
||||||
cloaks: cloakView,
|
cloaks: cloakView,
|
||||||
@@ -26,7 +25,7 @@ const CloakedCollectionView = Ember.CollectionView.extend({
|
|||||||
cloaksController: this.get('itemController'),
|
cloaksController: this.get('itemController'),
|
||||||
defaultHeight: this.get('defaultHeight'),
|
defaultHeight: this.get('defaultHeight'),
|
||||||
|
|
||||||
init: function() {
|
init() {
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
if (idProperty) {
|
if (idProperty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user