Commit Graph

1011 Commits

Author SHA1 Message Date
XhmikosR 3e7ca3bbc8 Minor lint tweaks. 2015-04-28 11:03:37 +03:00
Braden M. Kelley 4b269037cb Multiple tooltip triggers don't play well together
Fixes issue #16008
2015-04-27 23:03:56 -07:00
F A T aa479892d5 Merge pull request #16152 from jarthod/tooltip-placement-viewport-fix
Tooltip/popover: Fix auto placement to use viewport
2015-04-27 11:28:54 -07:00
Chris Rebert cdb37dce3a Set `box-sizing: border-box` on .container-viewport in #16142 testcase
Otherwise, the test doesn't properly fail when the fix is reverted.
2015-04-27 01:23:39 -07:00
Adrien 37a10d37c1 Compare tooltip right offset to viewport right offset (and not width)
Closes #16142 by merging it.
2015-04-27 01:13:16 -07:00
Chris Rebert fc372952e2 Throw error when tooltip/popover template has multiple top-level elements
Closes #16219.
2015-04-25 13:16:53 -07:00
Adrien Siami e949505b89 Allow viewport option to be a function
Closes #16151 by merging a rebased version of it that adds docs and 1 more assertion.
2015-04-21 22:20:15 -07:00
Chris Rebert c6b62f0cd9 Merge pull request #16147 from Johann-S/event_inserted
Fixes #16124.
2015-04-21 21:40:14 -07:00
Niels Steenbeek 7429fc7ff9 Tooltip: Destroy $tip, $arrow, $viewport to avoid memory leak
Closes #16039.
2015-04-20 23:29:31 -07:00
Patrick H. Lauke 8549722846 Merge pull request #16226 from patrickhlauke/radio-toggle-kbd-fix
Fix radio button toggle behavior for keyboard users
2015-04-17 18:19:11 +02:00
Patrick H. Lauke 66d71136e6 Fix existing radio button unit test 2015-04-11 19:24:21 +02:00
Patrick H. Lauke 1b9baa0d98 Don't preventDefault radio buttons
as this breaks keyboard navigation for radio button toggles (see
https://github.com/twbs/bootstrap/issues/16223)
2015-04-11 19:21:55 +02:00
Chris Rebert b8935a5d0c Use .dropdown-menu instead of ARIA roles for dropdown keydown event handler; fixes #16090 2015-04-08 19:20:15 -07:00
Johann-S 3d71eae301 Add event after template inserted 2015-04-08 13:10:53 +02:00
Adrien Jarthon 5921724d9c fixed IE incompatible CSS 2015-03-29 19:16:59 +02:00
Adrien Jarthon df96c3e615 Added non-regression test & fixed existing one 2015-03-29 14:59:21 +02:00
Heinrich Fenkart da63ff2e95 JSCS: Add "disallowSpacesInFunctionDeclaration"
Valid:

    function a() {}

Invalid:

    function a () {}
2015-03-26 18:28:17 +01:00
Chris Rebert 6c5e7dfce1 rm redundant aria-hidden usage from Modals; fixes #16020 2015-03-25 18:06:47 -07:00
Adrien Jarthon 0e8e5222ff Tooltip/popover: Fix auto placement to use viewport
Currently, auto placement is using the container dimensions (if provided) or the element's parent to determine where to open the tooltip:
```javascript
var $container   = this.options.container ? $(this.options.container) : this.$element.parent()
var containerDim = this.getPosition($container)
```
This is quite broken in fact, because the parent element could be just a small div outside the element for example, leading in a totally random placement (placing the tooltip on top even if there's no room). And the container can also be outside of the viewport.

This fix simply uses the viewport instead, that's the purpose of the viewport actually, to position the tooltip.
So the auto placement should use it to find where there's more room.
By default this is body, which is good.
2015-03-25 18:05:58 +01:00
Chris Rebert d37bc2ae65 Merge pull request #15987 from twbs/fix-15972
add role="button" to a[data-toggle="collapse"]
2015-03-24 08:57:56 -07:00
Emmanuel Bourgerie fa9d28b634 Fix #16072: Clicking into input field within dropdown no longer closes the dropdown
Closes #16073 by merging it
2015-03-21 16:00:15 -07:00
Chris Rebert 9aad9a4164 Merge pull request #16024 from twbs/unnecessary-parsing
avoid unnecessary HTML string building+parsing
2015-03-18 22:28:07 -07:00
Chris Rebert 4d652035dc v3.3.2 => v3.3.4 2015-03-16 08:39:31 -07:00
Maxim Andrukhovych 83371735fc Fixed proper navigation element selection on backward scrolling (from the bottom to the top) 2015-03-10 20:04:15 +00:00
Chris Rebert 1383b88328 Merge pull request #16012 from twbs/refs-12761
Disable jQuery event aliases when running test suite
2015-03-09 17:47:51 -07:00
Chris Rebert a14665e73e avoid unnecessary HTML string building+parsing 2015-03-09 06:47:34 -07:00
Chris Rebert a5243ad3d0 Affix: $('body') => $(document.body) 2015-03-09 06:43:41 -07:00
Chris Rebert 725c6848c3 Disable jQuery event aliases when running test suite
To ensure that we don't accidentally use any of the aliases.
This should prevent any future regressions from #12761.
Also updates the test suite since it now can't use these aliases either.
2015-03-09 01:05:43 -07:00
Chris Rebert 21d56378e1 Merge pull request #16011 from twbs/fix-15315
.collapse('hide') on hidden uninit-ed collapsible no longer shows it
2015-03-09 01:03:27 -07:00
Chris Rebert a134491fe5 add togglable scrollbar-inducing content to Modal visual test 2015-03-07 06:40:57 -08:00
Chris Rebert 6ddb8c2dd7 add static navbar to Modal visual test 2015-03-07 06:39:46 -08:00
Chris Rebert 64ca888cbc Merge pull request #15999 from twbs/kkirsche-includeTestsReadme
Document JS test suite basics
2015-03-06 23:28:30 -08:00
Kevin Kirsche ba2f7e92d0 [Fixes #15951] Document JS test suite basics
X-Ref: #15953
Closes #15952 by merging a tweaked version of it.
[skip sauce]
[skip validator]
2015-03-06 23:27:00 -08:00
Chris Rebert 5c8d56d515 Collapse unit test: rm check that no-op hide adds style="height: 0px"
Appears to be unnecessary and is broken by #16011,
which is otherwise quite sane.
2015-03-06 18:10:53 -08:00
Chris Rebert 872e56fcf2 .collapse('hide') on hidden uninit-ed collapsible no longer shows it; fixes #15315
Thanks to @peterblazejewicz & @Nikita240
Adds unit tests based on #14417
X-Ref: #14282
Closes #15807
2015-03-06 06:58:48 -08:00
Chris Rebert 27bbc7dbe9 Hiding an uninitialized tooltip/popover no longer initializes it; fixes #15874 2015-03-03 22:22:13 -08:00
Chris Rebert cc39f5c52d add role="button" to a[data-toggle="collapse"]; fixes #15972 2015-03-03 13:18:36 -08:00
Chris Rebert 168297c779 rm semicolon for sake of fat's eccentric tastes
Erratum from #15496
2015-03-03 13:06:32 -08:00
Heinrich Fenkart 420a8088a4 Merge pull request #15961 from kkirsche/ImplementAssertExpect
[Fixes #15953] Implement assert.expect in each unit test
2015-03-03 15:52:05 +01:00
Kevin Kirsche 4febcb4b49 [Fixes #15953] Implement assert.expect in each unit test
[Fixes #15953] Implement `assert.expect` in each unit test
2015-03-03 08:45:07 -05:00
Heinrich Fenkart f5beebe726 Modal: Fix backdrop not readjusting when height changes
Fixes #15136.
Closes #15345.
Closes #15314.
Refs #14724, #14927.
2015-03-03 05:27:26 +01:00
Chris Rebert 46f5a8f478 Merge pull request #15970 from twbs/the-future-is-now-qunit
Disable deprecated QUnit global methods
2015-03-02 02:39:29 -08:00
XhmikosR f8e34ff48b Disable es3 for tests and customizer.js. 2015-03-02 11:16:06 +02:00
Chris Rebert c291c12cb1 Disable deprecated global QUnit method aliases to prevent backsliding on QUnit v2 readiness 2015-03-01 19:50:11 -08:00
Chris Rebert c80872235f Merge pull request #15955 from twbs/fixture-on-screen-ios
Unit tests: Only display fixture on-screen for iOS
2015-03-01 18:28:46 -08:00
Chris Rebert 015e63f6df Merge pull request #15593 from neoeno/handle_multiple_zero_offset_scrollspy_elements
Handle multiple zero-offset Scrollspy elements.
2015-03-01 16:04:04 -08:00
Caden Lovelace a1aa0f8afd Handle multiple zero-offset Scrollspy elements.
When the first two elements in a scrollspy content block have a document
offset of zero (i.e. they're hard against the top of the page),
Scrollspy would switch between them on every scroll event.

This could happen, for example, in a system of nested sections:

```
<section id="animals">
  <section id="dogs">
	Content
  </section>
</section>
```

This ocurred because Scrollspy's check to see if it's at the end of the
array of sections uses `!arr[index]`. This misses the case where
`arr[index]` does exist and is zero.

This commit explicitly checks the array bounds.
2015-03-01 23:55:39 +00:00
Heinrich Fenkart 20fb55a840 Unit tests: Only display fixture on-screen for iOS
Since only on iOS tests fail when the fixture is displayed off-screen, see https://travis-ci.org/twbs/bootstrap/jobs/52605742
2015-03-01 09:49:59 +01:00
Heinrich Fenkart 4345e24479 Use different way to make failing test more visible in Sauce 2015-03-01 09:20:00 +01:00
Ivan Cheung d5071b19f1 Update all collapse triggers with .collapsed class and aria-expanded
Fixes #15741
Closes #15751 by merging it.
2015-02-26 18:48:20 -08:00
Chris Rebert 9afb61fffd QUnit.jsDump => QUnit.dump
Refs http://qunitjs.com/upgrade-guide-2.x/#replace-qunit-jsdump-with-qunit-dump
2015-02-25 23:29:27 -08:00
Chris Rebert 4ff9c54cdd Use QUnit.log(...) instead of QUnit.log = ...
Refs http://qunitjs.com/upgrade-guide-2.x/#replace-qunit-log-callback-with-qunit-log-callback-for-all-reporting-callbacks
2015-02-25 23:29:27 -08:00
Heinrich Fenkart 3bb05b5fbb Unit tests: Use new names of module hooks
Refs #15893
2015-02-26 08:20:42 +01:00
nakupanda 142a9e4ae0 Modal: Apply any preexisting body padding again after closing 2015-02-26 08:02:06 +01:00
Quentin Spencer-Harper acc5f65756 Tooltip: Avoid creating an unnecessary tooltip when `Tooltip#hide` is called
Fixed performance bug where a tooltip element is created and then immediately destroyed when tooltip.hide() is called and there is no existing tooltip element

Resolves #15557 by merging it.
2015-02-26 06:53:58 +01:00
vsn4ik b395f3526e Dropdowns: Skip `.disabled` instead of `.divider` on keydown event
Fixes #15147.
Closes #15520 by merging it.
2015-02-26 06:42:09 +01:00
Heinrich Fenkart cac6cfcd84 Merge pull request #15923 from kkirsche/useExplicitVariableDeclaration
[Ref #15881] Use Explicit JS Variable Declarations rather than Chained
2015-02-26 05:55:27 +01:00
Chris Rebert a339bfb0ac Merge pull request #15693 from huang-x-h/patch-1
tip method in popover.js can be removed
2015-02-25 19:49:26 -08:00
Kevin Kirsche 238be65786 [Ref #15881] Use Explicit Values rather than Chain
[Ref #15881] Use Explicit Values for javascript variables rather than chained ones.

From https://github.com/twbs/bootstrap/pull/15881#discussion_r25330647
2015-02-25 12:19:11 -05:00
Chris Rebert 804457c474 fix 2 typos in modal unit test assertion messages 2015-02-24 23:49:08 -08:00
Heinrich Fenkart c40c31a308 Dropdown unit tests: Tiny style changes 2015-02-25 02:53:39 +01:00
Heinrich Fenkart 6e0c843223 ScrollSpy: Small style consistency adjustments 2015-02-25 01:37:13 +01:00
Chris Rebert 2a6207c0c9 Merge pull request #15904 from kkirsche/patch-8
Closes #15904
2015-02-24 14:11:03 -08:00
Kevin Kirsche 696fc2e53c Add unit test of aria-expanded to dropdown suite
Redo of #15876
2015-02-24 14:09:08 -08:00
Kevin Kirsche 30d8cdf639 Add tests for aria-hidden of modal
Add tests for `aria-hidden` of modal

Use strictEqual of 1 here instead of 2 asserts
2015-02-24 16:29:40 -05:00
Chris Rebert ecd469ec16 Merge pull request #15893 from twbs/qunit-modern
Modernize QUnit usage by avoiding usage of global functions
2015-02-24 11:47:29 -08:00
Chris Rebert 9c75c855c6 JS unit tests: equal() => strictEqual()
[skip validator]
2015-02-23 22:43:17 -08:00
Chris Rebert bda4fe87ca upgrade to QUnit v1.17.1
[skip validator]
2015-02-23 22:18:51 -08:00
Chris Rebert 118b8c2695 JS unit tests: use QUnit.module() & QUnit.test() everywhere
[skip validator]
2015-02-23 22:14:11 -08:00
Chris Rebert 7c19fee3f1 JS unit tests: use modern QUnit assert object everywhere 2015-02-23 22:14:11 -08:00
Heinrich Fenkart 16479e9051 Merge pull request #15378 from twbs/fix-ie-modal-scrollbar-for-realz
Modal: Work around IE scrollbars not taking up page width
2015-02-24 03:33:32 +01:00
dormouse 91b384399c tip method in popover.js can be removed
Popover is extend Tooltip, the tip function can use tootltip's tip, so we can remove the tip function definition in popover to reduce the js filesize

tip function definition in tooltip.js https://github.com/tbs/bootstrap/blob/master/js/tooltip.js#L405-L407
2015-01-29 11:21:07 +08:00
Chris Rebert cd4467b194 Merge pull request #15496 from twbs/15484-alternative
Make $(document).tooltip({...}) without a `selector` throw an error
2015-01-28 11:05:40 -08:00
Chris Rebert af8fa54fcd Merge pull request #15630 from twbs/tabs-cond-fix
Fix error in condition in Tab plugin
2015-01-28 10:59:51 -08:00
Chris Rebert ebedeaf2fe Fix name of Tooltip.replaceArrow() parameter
isHorizontal => isVertical
2015-01-27 11:15:55 -08:00
Chris Rebert 426e8e12cd Fix error in condition in Tab plugin
Refs #15186
2015-01-21 14:13:26 -08:00
Chris Rebert 1652efc3f6 tweak 'close reopened modal' unit test to work under new QUnit API 2015-01-20 20:18:33 -08:00
Chris Rebert df73535a2d fix bug in tab show/shown relatedTarget unit test 2015-01-20 20:16:42 -08:00
Chris Rebert b56d97f210 update JS unit tests to future-proof QUnit 1.16.0 API
[skip validator]
2015-01-20 19:57:51 -08:00
XhmikosR a8139a0392 Update QUnit to v1.17.0. 2015-01-19 20:10:34 +02:00
Mark Otto c683e7dea7 bump versions 2015-01-19 08:32:13 -08:00
XhmikosR 0481ce973f Fix bogus JSCS warning. 2015-01-16 17:50:05 +02:00
XhmikosR 0e79fe1a9f Update JSCS config for the new version. 2015-01-16 17:49:58 +02:00
XhmikosR 9db1de2a3a Update jQuery to v1.11.2. 2015-01-07 00:31:18 +02:00
Chris Rebert 34f88e94fc window.Document doesn't exist in IE8 2015-01-05 14:47:33 -08:00
Chris Rebert f6a837cbf1 Make $(document).tooltip({...}) without a `selector` throw an error
Closes #15484
2015-01-05 14:22:49 -08:00
Zlatan Vasović 576230b92a Happy New Year 🎅 2015-01-01 01:23:48 +01:00
Chris Rebert adaabab81b Revert "Allow multiple delegated tooltip selectors on a node"
This reverts commit 1b3237629a.
This reverts PR #14189 because it caused major regressions.

Fixes #15168.

We'll try to revisit #14167's feature request in Bootstrap v4.

[skip validator]
2014-12-29 20:08:22 -08:00
Chris Rebert 32cb071594 Remove semicolons from #15425 because fat 2014-12-29 18:34:35 -08:00
Chris Rebert 27bfef5b35 Add regression test for #14244.
Special thanks to @programcsharp

[skip validator]
2014-12-29 16:09:37 -08:00
Chris Rebert 2ae4c0b03f JSCS: enable requireSpaceBetweenArguments
New rule added in JSCS v1.9.0
Our JS already complies with this.
2014-12-29 12:02:33 -08:00
Heinrich Fenkart 32f62bc565 Modal: Work around IE scrollbars not taking up page width
Fixes #15353.
2014-12-18 07:29:34 +01:00
Dan Dascalescu 2c64fc2c4d Fix copy/paste error 2014-11-28 04:30:04 -08:00
Chris Rebert bc5a753b67 fix affix-top unit test to properly clean up after itself 2014-11-20 23:26:37 -08:00
Nick O'Donoghue 36b4f90f25 Fixes affix-top class not applying
Use scrollTop instead of colliderTop which uses the elements
offset().top, as the offset top does not account for padding.

This issue can be replicated by using a navbar-fixed-top and applying
relevant padding to the body. (A navbar-static-top with no padding on
the body does not encounter this issue)

Fixes #15078
Closes #15154 by merging it
2014-11-17 18:17:42 -08:00
Nick O'Donoghue da79ab9488 add unit test for affix-top for padding issue 2014-11-17 18:17:40 -08:00
Chris Rebert b7398bc9c4 honor wrap option in Carousel.getItemForDirection; fixes #15144 2014-11-15 22:43:20 -08:00
Chris Rebert 8008fe707e add unit tests for Carousel's 'wrap' option 2014-11-15 22:37:55 -08:00
Heinrich Fenkart a577f1922e Collapse: Use $.fn.children instead of `>` in selector
Fixes #15131.
2014-11-14 15:18:34 +01:00
Mark Otto 9a7e365c2c bump version to v3.3.1 2014-11-12 09:03:16 -08:00