Skip to content

Commit

Permalink
cleaned app.js code
Browse files Browse the repository at this point in the history
  • Loading branch information
dejotb committed Aug 24, 2022
1 parent 8f994c5 commit 8ae275d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,27 +241,20 @@ class App {
_pinSelectedNote(e) {
const el = e.target.closest('.list__item');
const activeEl = listItems.querySelector(`[data-id='${el.dataset.id}']`);
// console.log(activeEl);
const activeElId = activeEl.getAttribute('data-id');
listItems.insertAdjacentElement('afterbegin', activeEl);

containerMain.style.opacity = 1;

// console.log(this.#notes);

const pinnedEl = this.#notes.filter((ele) => ele.id === activeElId);
// console.log(pinnedEl);

const indexOfActiveElInArray = this.#notes.findIndex(
(item) => item.id === activeElId
);

this.#notes.splice(indexOfActiveElInArray, 1);

// console.log(this.#notes);

this.#notes.push(...pinnedEl);
// console.log(this.#notes);
this._setLocalStorage('notes', this.#notes);
}

Expand Down

0 comments on commit 8ae275d

Please sign in to comment.