mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: Have the preview refreshed event fire by decorateCooked
This commit is contained in:
parent
f85d848649
commit
395d01c5f9
@ -89,7 +89,6 @@ export default Ember.Component.extend({
|
||||
_renderUnseen: function($preview, unseen) {
|
||||
fetchUnseenMentions($preview, unseen, this.siteSettings).then(() => {
|
||||
linkSeenMentions($preview, this.siteSettings);
|
||||
this.trigger('previewRefreshed', $preview);
|
||||
});
|
||||
},
|
||||
|
||||
@ -349,6 +348,7 @@ export default Ember.Component.extend({
|
||||
|
||||
// Paint oneboxes
|
||||
$('a.onebox', $preview).each((i, e) => Discourse.Onebox.load(e, refresh));
|
||||
this.trigger('previewRefreshed', $preview);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
@ -1,5 +1,6 @@
|
||||
let _decorateId = 0;
|
||||
import ComposerEditor from 'discourse/components/composer-editor';
|
||||
|
||||
let _decorateId = 0;
|
||||
function decorate(klass, evt, cb) {
|
||||
const mixin = {};
|
||||
mixin["_decorate_" + (_decorateId++)] = function($elem) { cb($elem); }.on(evt);
|
||||
@ -10,7 +11,7 @@ export function decorateCooked(container, cb) {
|
||||
const postView = container.lookupFactory('view:post');
|
||||
decorate(postView, 'postViewInserted', cb);
|
||||
decorate(postView, 'postViewUpdated', cb);
|
||||
decorate(container.lookupFactory('view:composer'), 'previewRefreshed', cb);
|
||||
decorate(ComposerEditor, 'previewRefreshed', cb);
|
||||
decorate(container.lookupFactory('view:embedded-post'), 'didInsertElement', cb);
|
||||
decorate(container.lookupFactory('view:user-stream'), 'didInsertElement', cb);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { headerHeight } from 'discourse/views/header';
|
||||
import { default as computed, on, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import Composer from 'discourse/models/composer';
|
||||
|
||||
const ComposerView = Ember.View.extend(Ember.Evented, {
|
||||
const ComposerView = Ember.View.extend({
|
||||
_lastKeyTimeout: null,
|
||||
elementId: 'reply-control',
|
||||
classNameBindings: ['composer.creatingPrivateMessage:private-message',
|
||||
|
Loading…
Reference in New Issue
Block a user