|
898 | 898 | for (var i = 0, len = interactions.length; i < len; i++) {
|
899 | 899 | var interaction = interactions[i],
|
900 | 900 | otherAction = /resize/.test(interaction.prepared)? 'resize': interaction.prepared,
|
901 |
| - active = interaction.dragging || interaction.resizing || interaction.gesturing; |
| 901 | + active = interaction.interacting(); |
902 | 902 |
|
903 | 903 | if (!active) { continue; }
|
904 | 904 |
|
|
1301 | 1301 | listeners.pointerHover);
|
1302 | 1302 | }
|
1303 | 1303 |
|
1304 |
| - if (this.target && this.target.options.styleCursor && !(this.dragging || this.resizing || this.gesturing)) { |
| 1304 | + if (this.target && this.target.options.styleCursor && !this.interacting()) { |
1305 | 1305 | document.documentElement.style.cursor = '';
|
1306 | 1306 | }
|
1307 | 1307 | },
|
|
1335 | 1335 | }
|
1336 | 1336 |
|
1337 | 1337 | // do nothing if interacting
|
1338 |
| - if (this.dragging || this.resizing || this.gesturing) { |
| 1338 | + if (this.interacting()) { |
1339 | 1339 | return;
|
1340 | 1340 | }
|
1341 | 1341 |
|
|
1426 | 1426 | var target = this.target,
|
1427 | 1427 | options = target && target.options;
|
1428 | 1428 |
|
1429 |
| - if (target && !(this.dragging || this.resizing || this.gesturing)) { |
| 1429 | + if (target && !this.interacting()) { |
1430 | 1430 | action = action || validateAction(forceAction || target.getAction(pointer, this), target, this.element);
|
1431 | 1431 |
|
1432 | 1432 | this.setEventXY(this.startCoords);
|
|
1511 | 1511 | && (!this.inertiaStatus.active || (pointer instanceof InteractEvent && /inertiastart/.test(pointer.type)))) {
|
1512 | 1512 |
|
1513 | 1513 | // if just starting an action, calculate the pointer speed now
|
1514 |
| - if (!(this.dragging || this.resizing || this.gesturing)) { |
| 1514 | + if (!this.interacting()) { |
1515 | 1515 | setEventDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
|
1516 | 1516 |
|
1517 | 1517 | // check if a drag is in the correct axis
|
|
1589 | 1589 | }
|
1590 | 1590 | }
|
1591 | 1591 |
|
1592 |
| - var starting = !!this.prepared && !(this.dragging || this.resizing || this.gesturing); |
| 1592 | + var starting = !!this.prepared && !this.interacting(); |
1593 | 1593 |
|
1594 | 1594 | if (starting && !withinInteractionLimit(this.target, this.element, this.prepared)) {
|
1595 | 1595 | this.stop();
|
|
1787 | 1787 | inertiaOptions = options && options.inertia,
|
1788 | 1788 | inertiaStatus = this.inertiaStatus;
|
1789 | 1789 |
|
1790 |
| - if (this.dragging || this.resizing || this.gesturing) { |
| 1790 | + if (this.interacting()) { |
1791 | 1791 |
|
1792 | 1792 | if (inertiaStatus.active) { return; }
|
1793 | 1793 |
|
|
2149 | 2149 | return (this.dragging && 'drag') || (this.resizing && 'resize') || (this.gesturing && 'gesture') || null;
|
2150 | 2150 | },
|
2151 | 2151 |
|
| 2152 | + interacting: function () { |
| 2153 | + return this.dragging || this.resizing || this.gesturing; |
| 2154 | + }, |
| 2155 | + |
2152 | 2156 | clearTargets: function () {
|
2153 | 2157 | if (this.target && !this.target.selector) {
|
2154 | 2158 | this.target = this.element = null;
|
|
2158 | 2162 | },
|
2159 | 2163 |
|
2160 | 2164 | stop: function (event) {
|
2161 |
| - if (this.dragging || this.resizing || this.gesturing) { |
| 2165 | + if (this.interacting()) { |
2162 | 2166 | autoScroll.stop();
|
2163 | 2167 | this.matches = [];
|
2164 | 2168 | this.matchElements = [];
|
|
2766 | 2770 | interaction = interactions[i];
|
2767 | 2771 |
|
2768 | 2772 | if ((!interaction.prepared || (interaction.target.gesturable()))
|
2769 |
| - && !(interaction.dragging || interaction.resizing || interaction.gesturing) |
| 2773 | + && !interaction.interacting() |
2770 | 2774 | && !(!mouseEvent && interaction.mouse)) {
|
2771 | 2775 |
|
2772 | 2776 | interaction.addPointer(pointer);
|
|
0 commit comments