Ember-Cloaking Doesn't Turn A Look

I am trying to integrate ember-cloaking into my application, but it looks like it is not working correctly. I currently have a list of 20 items that are displayed using this code:

{{each bands itemView='matrix_band' itemController='matrix_band'}}

This works exactly as I expected. So I changed this code:

{{cloaked-collection content=bands cloakView='matrix_band' itemController='matrix_band' defaultHeight=200 offsetFixed='.matrix-header'}}

When it first loads, it shows 6 visible elements on the screen, as I expected. But when I scroll down, I just get the text Loading.... However, it never divulges objects. If I scroll all the way down the page and look at the DOM, I see that it smoothly disguises the first 6 items, but it will not work with the remaining 14 elements.

How can i fix this? Is it possible that this is caused by Ember 1.5.1 instead of 1.3.0 (which demos use)?

EDIT: I was able to bend the fix together by replacing lines 135 and 136. Here is the original:

scrollOffset = this.get('wrapperTop') >> 0,
viewTop = $view.position().top + scrollOffset,

Here is my fix:

scrollOffset = $(window).scrollTop(),
viewTop = $view.position().top - scrollOffset,

Everything seemed to work fine, but the scroll seemed rather crude (it could only be my computer / browser). Also, it looks like a hack. I know that for each DOM element there are several different positions, but I know little about them. It seems strange that the ember-cloaking code will work for Discourse, and many other people, but not for me. Could this have anything to do with how my HTML and CSS are structured?

EDIT2: iMac, , Macbook, . , , - . , , , .

, - , , .

+4
1

. . , , . , , ? , - .

+1

Source: https://habr.com/ru/post/1539921/


All Articles