Hi there,
as I mentioned in my other thread I have replaced the rendering of the [ IMG ] bb code by a lazy loading of the images (I cannot use the browser function as I trigger the JS file which implements the lazy loading depending on the consent given by a cookie banner).
This results in the problem that after a reply is posted or a post is edited any image contained in the post will not be shown until a function UpDateLazy(); is triggered.
In case of the preview-button I modified XF.PreviewClick in the js/xf/core/action.js file (added the update function just after XF.layoutChange(); ).
However, I was not able to find the corresponding files where I have to place the call to the update function in case of submitting or editing a post/thread.
I also tried something like
as well as
Although this seemed to work at first glance it leads to an endless displaying of the progress bar (at the top of the display) when switching from the WYSIWYG editor mode to the bb code editor mode or backwards.
Does anyone have an idea how I can fire the update function upon an editing or submit event?
Thank you in advance!
as I mentioned in my other thread I have replaced the rendering of the [ IMG ] bb code by a lazy loading of the images (I cannot use the browser function as I trigger the JS file which implements the lazy loading depending on the consent given by a cookie banner).
This results in the problem that after a reply is posted or a post is edited any image contained in the post will not be shown until a function UpDateLazy(); is triggered.
In case of the preview-button I modified XF.PreviewClick in the js/xf/core/action.js file (added the update function just after XF.layoutChange(); ).
However, I was not able to find the corresponding files where I have to place the call to the update function in case of submitting or editing a post/thread.
I also tried something like
Code:
<script type="text/plain">
$(document).on('ajax:complete', function($data, $status, $xhr) {
UpDateLazy();
});</script>
as well as
Code:
<script type="text/plain">
(function ($, document)
{
$(document).on('xf:reinit', function ()
{
UpDateLazy();
});
})
(jQuery, document);
</script>
Although this seemed to work at first glance it leads to an endless displaying of the progress bar (at the top of the display) when switching from the WYSIWYG editor mode to the bb code editor mode or backwards.
Does anyone have an idea how I can fire the update function upon an editing or submit event?
Thank you in advance!