JS error when no forum posts to display

Issue #35 invalid
Manoj Solanki created an issue

When there are no news items, a js error related to the use of the slick jquery slider is shown when looking in the code inspector of a browser.

Comments (3)

  1. Manoj Solanki reporter
    • changed status to open

    Re-opened. Issue happens when using workaround below in custom JS to resolve issue when using Adaptable tabs and switching between them cause the slider to momentarily lose its format until next slide.It happens if you immediately switch tabs before next slide appears.

    <script type="text/javascript"> $("#coursetabcontainer :radio").on("change", function() { $('.responsive').slick('setPosition'); }); $("#dashboardtabcontainer :radio").on("change", function() { $('.responsive').slick('setPosition'); }); </script>

  2. Manoj Solanki reporter

    No way around this in the code found at the moment but any custom JS fixes must look like the following. So check that the JS method being called actually exists.

    <script type="text/javascript">if (typeof $('.responsive').slick === "function") {$("#coursetabcontainer :radio").on("change", function() {$('.responsive').slick('setPosition');});$("#dashboardtabcontainer :radio").on("change", function() {$('.responsive').slick('setPosition');});}</script>

  3. Log in to comment