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

Search #145

Open
wants to merge 12 commits into
base: version2.0
Choose a base branch
from
Open

Search #145

wants to merge 12 commits into from

Conversation

gigafiga21
Copy link

Added a search field.

let found = this.DOM.notes.found,
parent = found.parentNode;

this.DOM.notes.found = parent.removeChild(found).cloneNode(false);
Copy link
Member

Choose a reason for hiding this comment

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

innerHTML= '';


/**
* Push note data to array where search will be done
* @param {Object} data - data to push to the dataset
Copy link
Member

Choose a reason for hiding this comment

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

описать объект

pushData( data ) {
let existingDataIndex = this.dataset.length;

this.dataset.forEach((item, index) => {
Copy link
Member

Choose a reason for hiding this comment

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

написать комментарий


/**
* Remove note data from array where search will be done
* @param {Object} dataId - the id of data to remove from the dataset
Copy link
Member

Choose a reason for hiding this comment

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

это не объект

* @param {Object} dataId - the id of data to remove from the dataset
*/
removeData( dataId ) {
let existingDataIndex = this.dataset.length;
Copy link
Member

Choose a reason for hiding this comment

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

вынести код в метод

@@ -19,28 +27,35 @@
.aside__scrollable
.aside__scrollable-content(name="js-scrollable")

.aside__section-title Folders
.aside__content-wrap(name="js-folders-container")
Copy link
Member

Choose a reason for hiding this comment

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

проверить скролл

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

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

Svg optimize

//-
//- div.notes-list__scroll
//-
ul.notes-list__content(name="js-found-notes-menu", tabindex="0")
Copy link
Member

Choose a reason for hiding this comment

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

скрывать поиск после очистки инпута

if (!noteData.title) {
console.warn('Can not add Note to the Aside because it has no title', noteData);
return;
}

if (searchData) {
notesMenu = document.querySelector('[name="js-found-notes-menu"]');
Copy link
Member

Choose a reason for hiding this comment

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

перенести в else if

let item = $.make('li');

if (highlight) {
item.innerHTML = title.substring(0, highlight.start) +
Copy link
Member

Choose a reason for hiding this comment

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

replace

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.

2 participants