Conversation
khaydarov
suggested changes
Nov 26, 2018
reactions.js
Outdated
| * @returns {HTMLElement} div | ||
| */ | ||
| make(tagName, className) { | ||
| let div = document.createElement(tagName); |
There was a problem hiding this comment.
почему переменная называется div если функция принимает любой тег?
reactions.js
Outdated
| * @returns {HTMLElement} div | ||
| */ | ||
| * Create blocks and give CSS class | ||
| * @param {CSSClass} CSSClass - CSS class for block |
reactions.js
Outdated
| counter | ||
| ); | ||
|
|
||
| }else{ |
reactions.js
Outdated
| this.nodes.countBlock[i].innerHTML = ++this.count; | ||
|
|
||
| this.removeReaction( | ||
| itemActive, |
reactions.js
Outdated
|
|
||
| /** | ||
| * If we have an active count block write decreased counter | ||
| * @type {string} |
gohabereg
suggested changes
Nov 26, 2018
reactions.js
Outdated
| */ | ||
| make(tagName, className) { | ||
| let div = document.createElement(tagName); | ||
| let element = document.createElement(tagName); |
reactions.js
Outdated
| this.nodes.unicode = settings.emojiCodes; | ||
| this.titleText = settings.title; | ||
| this.appendElementsToWrapper(); | ||
| this.count=0; |
There was a problem hiding this comment.
Suggested change
| this.count=0; | |
| this.count = 0; |
| /** | ||
| * Append emoji and counter to emojiBlock | ||
| */ | ||
| appendElementsToEmojiBlock(){ |
There was a problem hiding this comment.
Нужно весь код прогнать через линтер
reactions.js
Outdated
| * Add emoji to button | ||
| * @type {string} | ||
| */ | ||
| this.nodes.button[i].innerText = String.fromCodePoint(this.nodes.unicode[i]); |
There was a problem hiding this comment.
Лучше использовать textContent
http://kellegous.com/j/2013/02/27/innertext-vs-textcontent/
reactions.js
Outdated
| * Find an active button | ||
| * @type {HTMLElement} | ||
| */ | ||
| let itemActive = document.querySelector('.reactions__button--active'); |
There was a problem hiding this comment.
Лучше сохранять это внутри класса, а не искать каждый раз в DOM
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.
No description provided.