Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes #191 - Fire before-change event in tabs components #192

Merged
merged 2 commits into from
Mar 23, 2018

Conversation

artsasin
Copy link
Contributor

Fire before-change event in tabs components. If event handler return false - not show clicked tab

Is this a bug fix or enhancement?

Enhancement

Is there a related issue?

Fixes #191

Any Breaking changes?

No

- fire before-change event in tabs components
- if event handler return false - not show clicked tab
@coveralls
Copy link

coveralls commented Mar 22, 2018

Coverage Status

Coverage increased (+0.01%) to 98.237% when pulling e181ae2 on artsasin:feature_tabs_before_change_event into 77e474b on wxsms:dev.

Copy link
Member

@wxsms wxsms left a comment

Choose a reason for hiding this comment

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

Thanks for the effort! pls:

  1. remove Promise usage because it is not supported by IE at all.
  2. use onBeforeChange(index, done), where index is the index to change, and done is the callback function, calling done() without param will allow the change, and done(err) (err can be anything) will deny it.
  3. no need for the timeout checking because it can totally control by user.

- remove Promises
- send 2 parameters (index, done function) to `before-change` event handler
- remove timeout
- code refactoring: emitting `input` event when `before-change` handler prevents tab display; remove currentIndex watcher
@artsasin
Copy link
Contributor Author

Requested changes resolved

@wxsms wxsms merged commit b44337e into uiv-lib:dev Mar 23, 2018
@wxsms
Copy link
Member

wxsms commented Mar 23, 2018

Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants