Open
Conversation
neSpecc
requested changes
Apr 1, 2019
Member
neSpecc
left a comment
There was a problem hiding this comment.
Модуль просто дописывает классы, а не осуществляет lazy load
talyguryn
requested changes
Apr 1, 2019
| </video> | ||
| <? endif; ?> | ||
| <div class="lazy-load js_lazy-load"> | ||
| <? if (strpos($plugin['demo'], 'mp4') === false): ?> |
Member
There was a problem hiding this comment.
что находится в поле demo? ссылка? а почему называется demo? но это меньшая проблема.
мало же проверять просто вхождение mp4. надо проверять наличие .mp4 в конце строки
| <img class="lazy-load__media js_lazy-media" src="<?= $plugin['demo'] ?>" alt="<?= $plugin['name'] ?>"> | ||
| <? else: ?> | ||
| <video class="lazy-load__media js_lazy-media" autoplay loop muted playsinline> | ||
| <source src="<?= $plugin['demo'] ?>" type="video/mp4"> |
Member
There was a problem hiding this comment.
зачем ты сразу прописываешь src у элемента? идея в том, чтобы не задавать этот параметр сразу. тот же путь к источнику прописывается, например, в data-src, а потом с помощью js подставляется в параметр src. тем самым получается, что эти элементы не тормозят загрузку страницы
khaydarov
reviewed
Apr 8, 2019
| /** | ||
| * Classes used in module | ||
| */ | ||
| static get classes() { |
Member
There was a problem hiding this comment.
мы везде этот геттер вроде называем CSS()
| */ | ||
| addLoadedClass(element) { | ||
|
|
||
| element.closest(`.${LazyLoad.classes.wrapper}`).classList.add(LazyLoad.classes.loaded); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lazy-loading module for images & videos