Skip to content
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

me first a pull request #7

Open
wants to merge 18 commits into
base: spokik-dev-events
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/addStaticOnLocalStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ function addStaticOnLocalStorage() {
else { sostav = ' состав неопределен' }
}
}

sostavAtPopup(sostav)
if(document.querySelector(`#userSS`) === null){
sostavAtPopup(sostav)
}


let params = {
saveScanStat: saveScanStat,
Expand Down Expand Up @@ -88,7 +90,7 @@ function addStaticOnLocalStorage() {
function sostavAtPopup(sostav) {
const elem = document.createElement("div")
elem.className = "b-popup-info"
elem.innerHTML = `<div class="b-popup-info-title">Состав</div><span class="b-popup-info-text js-popup-info-text" title="${sostav}">${sostav}</span>`
elem.innerHTML = `<div class="b-popup-info-title" id="userSS">Состав</div><span class="b-popup-info-text js-popup-info-text" title="${sostav}">${sostav}</span>`
let isYourSostav = false
function isCorrectSostav() {
for (let i = 0; i < usersSettings.usersSS.length; i++) {

Choose a reason for hiding this comment

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

the content of this loop can be written just in one line with the help of the ternary operation:
for (let i = 0; i < usersSettings.usersSS.length; i++) { return (isYourSostav = usersSettings.usersSS[i] == sostav ? true : false); }

Choose a reason for hiding this comment

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

and also below состав неопределен is it should be necessary the phrase with space before??

Expand Down