2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

BUGFIX: user screen.width cause it will be more correct

BUGFIX: fix deprecation and regression in cloaking
PERF: cache progressWidth super aggresively to avoid reflows
This commit is contained in:
Sam 2014-06-02 10:30:16 +10:00
parent 13f4afe00f
commit 97eba92a2e
3 changed files with 10 additions and 9 deletions

View file

@ -286,7 +286,7 @@
cloak: function() {
var self = this;
if (this._containedView && this.get('state') === 'inDOM') {
if (this._containedView && this._state === 'inDOM') {
var style = 'height: ' + this.$().height() + 'px;';
this.set('style', style);
this.$().prop('style', style);
@ -331,15 +331,15 @@
@method render
*/
render: function(buffer) {
var containedView = this._containedView;
var containedView = this._containedView, self = this;
if (containedView && containedView.get('state') !== 'inDOM') {
if (containedView && containedView._state !== 'inDOM') {
containedView.triggerRecursively('willInsertElement');
containedView.renderToBuffer(buffer);
containedView.transitionTo('inDOM');
Em.run.schedule('afterRender', function() {
if(this._containedView) {
this._containedView.triggerRecursively('didInsertElement');
if(self._containedView) {
self._containedView.triggerRecursively('didInsertElement');
}
});
}