Skip to content

Conversation

@overkam
Copy link
Owner

@overkam overkam commented Nov 25, 2018

No description provided.

reactions.js Outdated
* @returns {HTMLElement} div
*/
make(tagName, className) {
let div = document.createElement(tagName);

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

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{

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,

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}

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);

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.count=0;
this.count = 0;

/**
* Append emoji and counter to emojiBlock
*/
appendElementsToEmojiBlock(){

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]);

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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше сохранять это внутри класса, а не искать каждый раз в DOM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants