Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

feat(project): add items bindable #2

Merged
merged 10 commits into from Jan 11, 2017

Conversation

bas080
Copy link
Contributor

@bas080 bas080 commented Dec 21, 2016

This enables users to use and array with values to auto-complete on. When using
this bindable it disables the performing of requests.

Contains the necessary documentation which explains what methods can be
overwritten and the newly defined items bindable. Also updated the altered
bindables behavior documentation

@@ -74,6 +72,9 @@ export class AutoCompleteCustomElement {
return logger.error('auto complete requires resource or items bindable to be defined');
}

this.search = this.label(this.value);
this.justSelected = true;
Copy link
Member

Choose a reason for hiding this comment

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

Sloppy code style

@@ -131,14 +132,21 @@ export class AutoCompleteCustomElement {
}

/**
* returns HTML that wraps matching substrings with strong tags
* returns HTML that wraps matching substrings with strong tags. If not
Copy link
Member

Choose a reason for hiding this comment

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

Cut on new sentence or append on the end.

let openDropdown = (show = true) => {
this.showResults = show;
};
this.dropdownElement = this.element.querySelectorAll('.dropdown.open')[0];
Copy link
Member

Choose a reason for hiding this comment

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

Why is this still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because bootstrap.js will add and remove the open class for you

if (this.limit) {
query.limit = this.limit;
}

return query;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Remove newline

}

return this.findResults(this.searchQuery(this.search)).then(results => {
let promise = this.findResults(this.searchQuery(this.search)).then(results => {
Copy link
Member

Choose a reason for hiding this comment

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

Why not use: this.lastFindPromise = ....?

It's a sync process as far as I can see, so the assignment is basically the same, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's correct

This enables users to use and array with values to auto-complete on. When using
this bindable it disables the performing of requests.

Once noticable change is that an empty string will trigger a new search/filter
when the input receives focus.

Contains the necessary documentation which explains what methods can be
overwritten and the newly defined items bindable. Also updated the altered
bindables behavior documentation
@RWOverdijk
Copy link
Member

@VMBindraban and @jeremyvergnas please review.

}

this.lastFindPromise = this.findResults(this.searchQuery(this.search)).then(results => {
if (this.lastFindPromise !== promise) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed I guess

@RWOverdijk RWOverdijk merged commit c351533 into SpoonX:master Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants