-
Notifications
You must be signed in to change notification settings - Fork 0
Alpha version reactions 5 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
reactions.js
Outdated
| * @returns {HTMLElement} div | ||
| */ | ||
| make(tagName, className) { | ||
| let div = document.createElement(tagName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему переменная называется div если функция принимает любой тег?
reactions.js
Outdated
| * @returns {HTMLElement} div | ||
| */ | ||
| * Create blocks and give CSS class | ||
| * @param {CSSClass} CSSClass - CSS class for block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нет такого типа (CSSClass)
reactions.js
Outdated
| counter | ||
| ); | ||
|
|
||
| }else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} eles {
reactions.js
Outdated
| this.nodes.countBlock[i].innerHTML = ++this.count; | ||
|
|
||
| this.removeReaction( | ||
| itemActive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
код надо оформить нормально
reactions.js
Outdated
|
|
||
| /** | ||
| * If we have an active count block write decreased counter | ||
| * @type {string} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@type тут не нужен
reactions.js
Outdated
| */ | ||
| make(tagName, className) { | ||
| let div = document.createElement(tagName); | ||
| let element = document.createElement(tagName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
reactions.js
Outdated
| this.nodes.unicode = settings.emojiCodes; | ||
| this.titleText = settings.title; | ||
| this.appendElementsToWrapper(); | ||
| this.count=0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.count=0; | |
| this.count = 0; |
| /** | ||
| * Append emoji and counter to emojiBlock | ||
| */ | ||
| appendElementsToEmojiBlock(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно весь код прогнать через линтер
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше использовать 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше сохранять это внутри класса, а не искать каждый раз в DOM
No description provided.