Loading

Topic Shares

It seems we can’t find what you’re looking for. Perhaps searching can help.

Loading...
' + '' + '' ); }) .always(function() { xhr = null; }); } function closePanel() { $sp.removeClass('is-open'); $('body').removeClass('wpdm-sp-active'); if (xhr) { xhr.abort(); xhr = null; } // Clear body after animation completes setTimeout(function() { if (!$sp.hasClass('is-open')) { $body.empty(); currentUrl = null; } }, 350); } // Open: delegate click on .wpdm-popup-link (works for dynamic content) $(document).on('click', '.wpdm-popup-link', function(e) { e.preventDefault(); openPanel($(this).data('title') || $(this).text(), this.href); }); // Close: close button $sp.on('click', '.wpdm-sp__close', closePanel); // Close: backdrop click $sp.on('click', '.wpdm-sp__backdrop', closePanel); // Close: ESC key $(document).on('keydown', function(e) { if (e.key === 'Escape' && $sp.hasClass('is-open')) { closePanel(); } }); // Retry on error $sp.on('click', '.wpdm-sp__error-retry', function() { if (currentUrl) { var title = $title.text(); openPanel(title, currentUrl); } }); });