-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- SVGs don't have height in Firefox, so we have to fallback to the parentElement's height in order to calculate scale correctly. When the `drag` handler was used on a `.handle` element that was an SVG, the value of `scale` was always zero. Now it is the correct value (usually 1). - Use the `transitionend` event to wait for events to finish. In chrome, these animations were scheduled in such a way that the dom elements were technically in the right order but visually inaccurate if we slowed the transitions down. In Firefox, the smoke tests failed due to the elements being out of order. In addition to using the `transitionend` event (which is supported by all browsers we support(https://developer.mozilla.org/en-US/docs/Web/Events/transitionend#Browser_compatibility), when `DEBUG` mode is active (e.g. development or test builds, not production builds`, we emit a custom event on the document and use a custom waiter to prevent Ember from advancing the test suite too fast before the transitions are done (the transforms need to finish so that the elements are in the correct order in the dom). - Add Firefox to our .travis.yml and testem.js files so that we test against Firefox in CI.
- Loading branch information
1 parent
859947e
commit 3d85276
Showing
8 changed files
with
72 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ sudo: false | |
dist: trusty | ||
|
||
addons: | ||
firefox: latest | ||
chrome: stable | ||
|
||
cache: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { registerWaiter } from '@ember/test'; | ||
|
||
let dropStarts = 0; | ||
/** | ||
* Watch for transitions to start and end before allowing ember to | ||
* continue the test suite. Since we can't use transitionstart reliably in | ||
* all browsers, but we can use transitionend, we emit our own custom | ||
* event that is only used in tests. | ||
*/ | ||
registerWaiter(() => { | ||
return dropStarts === 0; | ||
}); | ||
document.addEventListener('ember-sortable-drop-start', () => { | ||
dropStarts++; | ||
}); | ||
document.addEventListener('ember-sortable-drop-stop', () => { | ||
dropStarts--; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import 'ember-sortable/helpers/drag'; | ||
import 'ember-sortable/helpers/reorder'; | ||
import 'ember-sortable/helpers/waiters'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters