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

[V4] Throw error when a plugin is in transition #17823

Merged
merged 2 commits into from
Dec 2, 2016
Merged

[V4] Throw error when a plugin is in transition #17823

merged 2 commits into from
Dec 2, 2016

Conversation

Johann-S
Copy link
Member

@Johann-S Johann-S commented Oct 9, 2015

Hi,

Feature #17800

I'll try to add some unit tests but I'm not sure it will works very well because of transition support isn't enable when tests are run with Grunt

@Johann-S
Copy link
Member Author

Johann-S commented Oct 9, 2015

As I said because of this lines : https://github.com/twbs/bootstrap/blob/v4-dev/js/src/util.js#L48-L50

I can't make unit tests with QUnit.

So, Should I try in differents html files in the visual folders ?

@cvrebert
Copy link
Collaborator

Yes, please add tests for this in one new HTML visual test file.

@@ -53,6 +53,21 @@
<script src="../vendor/jquery.min.js"></script>
<script src="../../dist/util.js"></script>
<script src="../../dist/carousel.js"></script>
<script type="text/javascript">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the type="text/javascript" for consistency with the rest of the project

@Johann-S
Copy link
Member Author

Done ! If you any feedbacks let me know

$('#btnOne').tooltip('hide').off('shown.bs.tooltip')
})
}
alert('No error thrown for : testTooltipTransitionError')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will always alert, no matter whether an error was thrown.
You need to keep a boolean variable to track whether an error was thrown, and then put this alert() inside an if that uses that variable.

@cvrebert
Copy link
Collaborator

Also, this has merge conflicts.
Thanks again for working on this!

@Johann-S
Copy link
Member Author

I made changes in modal.js but it's not shown here...
It seems Travis don't want to check my PR

Sorry to ask @cvrebert but how can I get the last updates of the branch v4-dev on my branch and fix conflicts ?
And thank you for your feedbacks !

@cvrebert
Copy link
Collaborator

It should just be a matter of pulling and rebasing like you've done in the past.

@Johann-S
Copy link
Member Author

I've just learned this command git pull --rebase 😃

Now they are no conflicts, if you want I can squash my commits

@Johann-S
Copy link
Member Author

Johann-S commented Nov 2, 2015

Sorry to PING you @cvrebert I know you have a lot of works to do but... Yes I'm a impatient man 😄 and I love contributing for Bootstrap

@mdo
Copy link
Member

mdo commented Oct 29, 2016

This has some conflicts now, but if it gets rebased and is good to go, I can get it merged.

@Johann-S
Copy link
Member Author

Johann-S commented Oct 29, 2016

I'll rebase my PR soon thanks you ❤️

@Johann-S
Copy link
Member Author

Done @mdo 💪

@mdo
Copy link
Member

mdo commented Nov 26, 2016

So, uh, we have more conflicts. 😆 Can I get one more rebase?

@mdo mdo added this to the v4.0.0-alpha.6 milestone Nov 26, 2016
if (this._isTransitioning) {
throw new Error('Tooltip is transitioning')
}
let complete = () => {

Choose a reason for hiding this comment

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

'complete' is never reassigned. Use 'const' instead prefer-const

@Johann-S
Copy link
Member Author

Done @mdo 👍 please tel me it's the last time 😆

@mdo mdo merged commit 297c47c into twbs:v4-dev Dec 2, 2016
@mdo
Copy link
Member

mdo commented Dec 2, 2016

We did it! Thanks again @Johann-S! <3

@Johann-S Johann-S deleted the feat-1 branch December 2, 2016 20:04
@JD-Robbs
Copy link

JD-Robbs commented Jan 7, 2017

I wonder if there is a way to force stop transitions before hiding? When using Bootstrap with Angular/Knockout, etc. and dynamically binding Tooltip/Modal/etc., then there needs to be a way to quickly tear-down and re-initialise these plugins.

pvdlg added a commit to pvdlg/bootstrap that referenced this pull request Jan 16, 2017
pvdlg added a commit to pvdlg/bootstrap that referenced this pull request Jan 28, 2017
* js-transitioning-1:
  Add callout regarding async methods and add some details to some JS methods
  Add callout for JS asynchronous modules
  Fix mention of transition.js => util.js
  Mention that JS methods are asynchronous in the Javascript docs
  Make modal, like other component, ignore command when transitioning
  Do not re-add the tooltip to the document if it’s already there. Avoid the tooltip suddenly disappearing and reappearing when hovering on and off
  Revert twbs#17823

# Conflicts:
#	js/src/modal.js
#	js/src/tooltip.js
Johann-S pushed a commit to pvdlg/bootstrap that referenced this pull request Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants