Closed KozyLigh closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions.
Greetings,
the original code for addClass breaks when adding lg-video-playing lg-has-video classes.
Using version: lightgallery.js | 0.0.2 | August 4th 2016
Error: lightgallery.min.js:7 Uncaught InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('lg-video-playing lg-has-video') contains HTML space characters, which are not valid in tokens.
I made a quick workaround for myself (not production code):
addClass: function addClass(el, className) { if (!el) { return; } if (el.classList) { var classArray = className.split(' '); for(var i = 0, len = classArray.length; i < len; i++){ el.classList.add(classArray[i]); }
With regards,
Marko