Replacing the body by prepending HTML results in the full content being re-rendered. This can be a performance issue, but is definitely annoying when embedding media in ticks.
This commit is contained in:
parent
04131a1d99
commit
d75b790ccf
@ -85,6 +85,7 @@ caching time of 12 hours obviously makes no sense.
|
|||||||
* Use GMT for automatic updates
|
* Use GMT for automatic updates
|
||||||
* Gutenberg Block available
|
* Gutenberg Block available
|
||||||
* Ticks exposed through REST API
|
* Ticks exposed through REST API
|
||||||
|
* Changed AJAX update logic for embedded media compatibility
|
||||||
|
|
||||||
### 1.0.0 - 2018-11-02
|
### 1.0.0 - 2018-11-02
|
||||||
|
|
||||||
|
@ -164,8 +164,15 @@
|
|||||||
* @return {void}
|
* @return {void}
|
||||||
*/
|
*/
|
||||||
var updateHTML = function( t, u ) {
|
var updateHTML = function( t, u ) {
|
||||||
// Prepend HTML of new ticks.
|
// Parse new DOM-part.
|
||||||
t.e.innerHTML = u.h + t.e.innerHTML;
|
var n = document.createElement( 'ul' );
|
||||||
|
n.innerHTML = u.h;
|
||||||
|
|
||||||
|
// Prepend new ticks to container.
|
||||||
|
while ( n.hasChildNodes() ) {
|
||||||
|
t.e.prepend( n.lastChild );
|
||||||
|
}
|
||||||
|
|
||||||
t.e.parentNode.setAttribute( 'data-sclt-last', u.t );
|
t.e.parentNode.setAttribute( 'data-sclt-last', u.t );
|
||||||
|
|
||||||
// Remove tail, if limit is set.
|
// Remove tail, if limit is set.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user