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

Event and total number of class change #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahmadlimbada
Copy link

changed update event binding to open style manager from selector and limited total shown classes to 5

PS: sorry for linting change

@lexoyo
Copy link
Member

lexoyo commented Aug 29, 2022

Hello @ahmadlimbada
I am so sorry I did not see your PR before !
Would you explain what you did? The linting changes make it hard to decode :-/
Also I like single quotes

Copy link
Member

@lexoyo lexoyo left a comment

Choose a reason for hiding this comment

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

I would be happy to accept with these changes

  1. the max number of classes displayed should be an option
  2. add a linter and/or a .editorconfig so that we can share the same linting rules (single quotes would be better but it is not a big deal)

.sort((first, second) => second.count - first.count)
// only classes which are in use
.filter(({ sel, count }) => count > 0)
.slice(0, 5)
Copy link
Member

Choose a reason for hiding this comment

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

Good idea !

But this should be an option, e.g. options.numClasses

})
input.addEventListener("blur", () => update(false));
input.addEventListener("focus", () => update(true, input.value));
editor.on("start:open-sm", () => update(false));
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch @ahmadlimbada !!

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