LEFT | RIGHT |
1 // Copyright 2006 The Closure Library Authors. All Rights Reserved. | 1 // Copyright 2006 The Closure Library Authors. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS-IS" BASIS, | 10 // distributed under the License is distributed on an "AS-IS" BASIS, |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 goog.require('goog.dom'); | 29 goog.require('goog.dom'); |
30 goog.require('goog.events'); | 30 goog.require('goog.events'); |
31 goog.require('goog.events.BrowserEvent.MouseButton'); | 31 goog.require('goog.events.BrowserEvent.MouseButton'); |
32 goog.require('goog.events.Event'); | 32 goog.require('goog.events.Event'); |
33 goog.require('goog.events.EventHandler'); | 33 goog.require('goog.events.EventHandler'); |
34 goog.require('goog.events.EventTarget'); | 34 goog.require('goog.events.EventTarget'); |
35 goog.require('goog.events.EventType'); | 35 goog.require('goog.events.EventType'); |
36 goog.require('goog.math.Coordinate'); | 36 goog.require('goog.math.Coordinate'); |
37 goog.require('goog.math.Rect'); | 37 goog.require('goog.math.Rect'); |
| 38 goog.require('goog.style'); |
| 39 goog.require('goog.style.bidi'); |
38 goog.require('goog.userAgent'); | 40 goog.require('goog.userAgent'); |
39 | 41 |
40 | 42 |
41 | 43 |
42 /** | 44 /** |
43 * A class that allows mouse or touch-based dragging (moving) of an element | 45 * A class that allows mouse or touch-based dragging (moving) of an element |
44 * | 46 * |
45 * @param {Element} target The element that will be dragged. | 47 * @param {Element} target The element that will be dragged. |
46 * @param {Element=} opt_handle An optional handle to control the drag, if null | 48 * @param {Element=} opt_handle An optional handle to control the drag, if null |
47 * the target is used. | 49 * the target is used. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 | 115 |
114 /** | 116 /** |
115 * Object representing the limits of the drag region. | 117 * Object representing the limits of the drag region. |
116 * @type {goog.math.Rect} | 118 * @type {goog.math.Rect} |
117 */ | 119 */ |
118 goog.fx.Dragger.prototype.limits; | 120 goog.fx.Dragger.prototype.limits; |
119 | 121 |
120 | 122 |
121 /** | 123 /** |
| 124 * Whether the element is rendered right-to-left. We initialize this lazily. |
| 125 * @type {boolean|undefined}} |
| 126 * @private |
| 127 */ |
| 128 goog.fx.Dragger.prototype.rightToLeft_; |
| 129 |
| 130 |
| 131 /** |
122 * Current x position of mouse or touch relative to viewport. | 132 * Current x position of mouse or touch relative to viewport. |
123 * @type {number} | 133 * @type {number} |
124 */ | 134 */ |
125 goog.fx.Dragger.prototype.clientX = 0; | 135 goog.fx.Dragger.prototype.clientX = 0; |
126 | 136 |
127 | 137 |
128 /** | 138 /** |
129 * Current y position of mouse or touch relative to viewport. | 139 * Current y position of mouse or touch relative to viewport. |
130 * @type {number} | 140 * @type {number} |
131 */ | 141 */ |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 254 |
245 /** | 255 /** |
246 * Whether IE drag events cancelling is on. | 256 * Whether IE drag events cancelling is on. |
247 * @type {boolean} | 257 * @type {boolean} |
248 * @private | 258 * @private |
249 */ | 259 */ |
250 goog.fx.Dragger.prototype.ieDragStartCancellingOn_ = false; | 260 goog.fx.Dragger.prototype.ieDragStartCancellingOn_ = false; |
251 | 261 |
252 | 262 |
253 /** | 263 /** |
| 264 * Whether the dragger implements the changes described in http://b/6324964, |
| 265 * making it truly RTL. This is a temporary flag to allow clients to transition |
| 266 * to the new behavior at their convenience. At some point it will be the |
| 267 * default. |
| 268 * @type {boolean} |
| 269 * @private |
| 270 */ |
| 271 goog.fx.Dragger.prototype.useRightPositioningForRtl_ = false; |
| 272 |
| 273 |
| 274 /** |
| 275 * Turns on/off true RTL behavior. This should be called immediately after |
| 276 * construction. This is a temporary flag to allow clients to transition |
| 277 * to the new component at their convenience. At some point true will be the |
| 278 * default. |
| 279 * @param {boolean} useRightPositioningForRtl True if "right" should be used for |
| 280 * positioning, false if "left" should be used for positioning. |
| 281 */ |
| 282 goog.fx.Dragger.prototype.enableRightPositioningForRtl = |
| 283 function(useRightPositioningForRtl) { |
| 284 this.useRightPositioningForRtl_ = useRightPositioningForRtl; |
| 285 }; |
| 286 |
| 287 |
| 288 /** |
254 * Returns the event handler, intended for subclass use. | 289 * Returns the event handler, intended for subclass use. |
255 * @return {goog.events.EventHandler} The event handler. | 290 * @return {goog.events.EventHandler} The event handler. |
256 */ | 291 */ |
257 goog.fx.Dragger.prototype.getHandler = function() { | 292 goog.fx.Dragger.prototype.getHandler = function() { |
258 return this.eventHandler_; | 293 return this.eventHandler_; |
259 }; | 294 }; |
260 | 295 |
261 | 296 |
262 /** | 297 /** |
263 * Sets (or reset) the Drag limits after a Dragger is created. | 298 * Sets (or reset) the Drag limits after a Dragger is created. |
264 * @param {goog.math.Rect?} limits Object containing left, top, width, | 299 * @param {goog.math.Rect?} limits Object containing left, top, width, |
265 * height for new Dragger limits. | 300 * height for new Dragger limits. If target is right-to-left and |
| 301 * enableRightPositioningForRtl(true) is called, then rect is interpreted as |
| 302 * right, top, width, and height. |
266 */ | 303 */ |
267 goog.fx.Dragger.prototype.setLimits = function(limits) { | 304 goog.fx.Dragger.prototype.setLimits = function(limits) { |
268 this.limits = limits || new goog.math.Rect(NaN, NaN, NaN, NaN); | 305 this.limits = limits || new goog.math.Rect(NaN, NaN, NaN, NaN); |
269 }; | 306 }; |
270 | 307 |
271 | 308 |
272 /** | 309 /** |
273 * Sets the distance the user has to drag the element before a drag operation is | 310 * Sets the distance the user has to drag the element before a drag operation is |
274 * started. | 311 * started. |
275 * @param {number} distance The number of pixels after which a mousedown and | 312 * @param {number} distance The number of pixels after which a mousedown and |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 * @param {boolean} enabled Whether dragger is enabled. | 362 * @param {boolean} enabled Whether dragger is enabled. |
326 */ | 363 */ |
327 goog.fx.Dragger.prototype.setEnabled = function(enabled) { | 364 goog.fx.Dragger.prototype.setEnabled = function(enabled) { |
328 this.enabled_ = enabled; | 365 this.enabled_ = enabled; |
329 }; | 366 }; |
330 | 367 |
331 | 368 |
332 /** @override */ | 369 /** @override */ |
333 goog.fx.Dragger.prototype.disposeInternal = function() { | 370 goog.fx.Dragger.prototype.disposeInternal = function() { |
334 goog.fx.Dragger.superClass_.disposeInternal.call(this); | 371 goog.fx.Dragger.superClass_.disposeInternal.call(this); |
335 | |
336 goog.events.unlisten(this.handle, | 372 goog.events.unlisten(this.handle, |
337 [goog.events.EventType.TOUCHSTART, goog.events.EventType.MOUSEDOWN], | 373 [goog.events.EventType.TOUCHSTART, goog.events.EventType.MOUSEDOWN], |
338 this.startDrag, false, this); | 374 this.startDrag, false, this); |
339 this.eventHandler_.dispose(); | 375 this.cleanUpAfterDragging_(); |
340 | 376 |
341 delete this.target; | 377 this.target = null; |
342 delete this.handle; | 378 this.handle = null; |
343 delete this.eventHandler_; | 379 this.eventHandler_ = null; |
| 380 }; |
| 381 |
| 382 |
| 383 /** |
| 384 * Whether the DOM element being manipulated is rendered right-to-left. |
| 385 * @return {boolean} True if the DOM element is rendered right-to-left, false |
| 386 * otherwise. |
| 387 * @private |
| 388 */ |
| 389 goog.fx.Dragger.prototype.isRightToLeft_ = function() { |
| 390 if (!goog.isDef(this.rightToLeft_)) { |
| 391 this.rightToLeft_ = goog.style.isRightToLeft(this.target); |
| 392 } |
| 393 return this.rightToLeft_; |
344 }; | 394 }; |
345 | 395 |
346 | 396 |
347 /** | 397 /** |
348 * Event handler that is used to start the drag | 398 * Event handler that is used to start the drag |
349 * @param {goog.events.BrowserEvent} e Event object. | 399 * @param {goog.events.BrowserEvent} e Event object. |
350 */ | 400 */ |
351 goog.fx.Dragger.prototype.startDrag = function(e) { | 401 goog.fx.Dragger.prototype.startDrag = function(e) { |
352 var isMouseDown = e.type == goog.events.EventType.MOUSEDOWN; | 402 var isMouseDown = e.type == goog.events.EventType.MOUSEDOWN; |
353 | 403 |
354 // Dragger.startDrag() can be called by AbstractDragDrop with a mousemove | 404 // Dragger.startDrag() can be called by AbstractDragDrop with a mousemove |
355 // event and IE does not report pressed mouse buttons on mousemove. Also, | 405 // event and IE does not report pressed mouse buttons on mousemove. Also, |
356 // it does not make sense to check for the button if the user is already | 406 // it does not make sense to check for the button if the user is already |
357 // dragging. | 407 // dragging. |
358 | 408 |
359 if (this.enabled_ && !this.dragging_ && | 409 if (this.enabled_ && !this.dragging_ && |
360 (!isMouseDown || e.isMouseActionButton())) { | 410 (!isMouseDown || e.isMouseActionButton())) { |
361 if (this.hysteresisDistanceSquared_ == 0) { | 411 if (this.hysteresisDistanceSquared_ == 0) { |
362 this.initializeDrag_(e); | 412 if (this.fireDragStart_(e)) { |
363 if (this.dragging_) { | 413 this.dragging_ = true; |
364 e.preventDefault(); | 414 e.preventDefault(); |
365 } else { | 415 } else { |
366 // If the start drag is cancelled, don't setup for a drag. | 416 // If the start drag is cancelled, don't setup for a drag. |
367 return; | 417 return; |
368 } | 418 } |
369 } else { | 419 } else { |
370 // Need to preventDefault for hysteresis to prevent page getting selected. | 420 // Need to preventDefault for hysteresis to prevent page getting selected. |
371 e.preventDefault(); | 421 e.preventDefault(); |
372 } | 422 } |
373 this.setupDragHandlers(); | 423 this.setupDragHandlers(); |
374 | 424 |
375 this.clientX = this.startX = e.clientX; | 425 this.clientX = this.startX = e.clientX; |
376 this.clientY = this.startY = e.clientY; | 426 this.clientY = this.startY = e.clientY; |
377 this.screenX = e.screenX; | 427 this.screenX = e.screenX; |
378 this.screenY = e.screenY; | 428 this.screenY = e.screenY; |
379 this.deltaX = this.target.offsetLeft; | 429 this.deltaX = this.useRightPositioningForRtl_ ? |
| 430 goog.style.bidi.getOffsetStart(this.target) : this.target.offsetLeft; |
380 this.deltaY = this.target.offsetTop; | 431 this.deltaY = this.target.offsetTop; |
381 this.pageScroll = goog.dom.getDomHelper(this.document_).getDocumentScroll(); | 432 this.pageScroll = goog.dom.getDomHelper(this.document_).getDocumentScroll(); |
382 | 433 |
383 this.mouseDownTime_ = goog.now(); | 434 this.mouseDownTime_ = goog.now(); |
384 } else { | 435 } else { |
385 this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL); | 436 this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL); |
386 } | 437 } |
387 }; | 438 }; |
388 | 439 |
389 | 440 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 478 } |
428 | 479 |
429 if (this.scrollTarget_) { | 480 if (this.scrollTarget_) { |
430 this.eventHandler_.listen(this.scrollTarget_, goog.events.EventType.SCROLL, | 481 this.eventHandler_.listen(this.scrollTarget_, goog.events.EventType.SCROLL, |
431 this.onScroll_, useCapture); | 482 this.onScroll_, useCapture); |
432 } | 483 } |
433 }; | 484 }; |
434 | 485 |
435 | 486 |
436 /** | 487 /** |
437 * Event handler that is used to start the drag | 488 * Fires a goog.fx.Dragger.EventType.START event. |
438 * @param {goog.events.BrowserEvent|goog.events.Event} e Event object. | 489 * @param {goog.events.BrowserEvent} e Browser event that triggered the drag. |
439 * @private | 490 * @return {boolean} False iff preventDefault was called on the DragEvent. |
440 */ | 491 * @private |
441 goog.fx.Dragger.prototype.initializeDrag_ = function(e) { | 492 */ |
442 var rv = this.dispatchEvent(new goog.fx.DragEvent( | 493 goog.fx.Dragger.prototype.fireDragStart_ = function(e) { |
443 goog.fx.Dragger.EventType.START, this, e.clientX, e.clientY, | 494 return this.dispatchEvent(new goog.fx.DragEvent( |
444 /** @type {goog.events.BrowserEvent} */(e))); | 495 goog.fx.Dragger.EventType.START, this, e.clientX, e.clientY, e)); |
445 if (rv !== false) { | 496 }; |
446 this.dragging_ = true; | 497 |
447 } | 498 |
448 }; | 499 /** |
449 | 500 * Unregisters the event handlers that are only active during dragging, and |
450 | 501 * releases mouse capture. |
451 /** | 502 * @private |
452 * Event handler that is used to end the drag | 503 */ |
| 504 goog.fx.Dragger.prototype.cleanUpAfterDragging_ = function() { |
| 505 this.eventHandler_.removeAll(); |
| 506 if (goog.fx.Dragger.HAS_SET_CAPTURE_) { |
| 507 this.document_.releaseCapture(); |
| 508 } |
| 509 }; |
| 510 |
| 511 |
| 512 /** |
| 513 * Event handler that is used to end the drag. |
453 * @param {goog.events.BrowserEvent} e Event object. | 514 * @param {goog.events.BrowserEvent} e Event object. |
454 * @param {boolean=} opt_dragCanceled Whether the drag has been canceled. | 515 * @param {boolean=} opt_dragCanceled Whether the drag has been canceled. |
455 */ | 516 */ |
456 goog.fx.Dragger.prototype.endDrag = function(e, opt_dragCanceled) { | 517 goog.fx.Dragger.prototype.endDrag = function(e, opt_dragCanceled) { |
457 this.eventHandler_.removeAll(); | 518 this.cleanUpAfterDragging_(); |
458 | |
459 if (goog.fx.Dragger.HAS_SET_CAPTURE_) { | |
460 this.document_.releaseCapture(); | |
461 } | |
462 | |
463 var x = this.limitX(this.deltaX); | |
464 var y = this.limitY(this.deltaY); | |
465 | 519 |
466 if (this.dragging_) { | 520 if (this.dragging_) { |
467 this.dragging_ = false; | 521 this.dragging_ = false; |
468 | 522 |
469 var dragCancelled = opt_dragCanceled || | 523 var x = this.limitX(this.deltaX); |
470 e.type == goog.events.EventType.TOUCHCANCEL; | 524 var y = this.limitY(this.deltaY); |
| 525 var dragCanceled = opt_dragCanceled || |
| 526 e.type == goog.events.EventType.TOUCHCANCEL; |
471 this.dispatchEvent(new goog.fx.DragEvent( | 527 this.dispatchEvent(new goog.fx.DragEvent( |
472 goog.fx.Dragger.EventType.END, this, e.clientX, e.clientY, e, x, y, | 528 goog.fx.Dragger.EventType.END, this, e.clientX, e.clientY, e, x, y, |
473 dragCancelled)); | 529 dragCanceled)); |
474 } else { | 530 } else { |
475 this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL); | 531 this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL); |
476 } | 532 } |
477 | 533 |
478 // Call preventDefault to prevent mouseup from being raised if this is a | 534 // Call preventDefault to prevent mouseup from being raised if this is a |
479 // touchend event. | 535 // touchend event. |
480 if (e.type == goog.events.EventType.TOUCHEND || | 536 if (e.type == goog.events.EventType.TOUCHEND || |
481 e.type == goog.events.EventType.TOUCHCANCEL) { | 537 e.type == goog.events.EventType.TOUCHCANCEL) { |
482 e.preventDefault(); | 538 e.preventDefault(); |
483 } | 539 } |
484 }; | 540 }; |
485 | 541 |
486 | 542 |
487 /** | 543 /** |
488 * Event handler that is used to end the drag by cancelling it. | 544 * Event handler that is used to end the drag by cancelling it. |
489 * @param {goog.events.BrowserEvent} e Event object. | 545 * @param {goog.events.BrowserEvent} e Event object. |
490 */ | 546 */ |
491 goog.fx.Dragger.prototype.endDragCancel = function(e) { | 547 goog.fx.Dragger.prototype.endDragCancel = function(e) { |
492 this.endDrag(e, true); | 548 this.endDrag(e, true); |
493 }; | 549 }; |
494 | 550 |
495 | 551 |
496 /** | 552 /** |
497 * Event handler that is used on mouse / touch move to update the drag | 553 * Event handler that is used on mouse / touch move to update the drag |
498 * @param {goog.events.BrowserEvent} e Event object. | 554 * @param {goog.events.BrowserEvent} e Event object. |
499 * @private | 555 * @private |
500 */ | 556 */ |
501 goog.fx.Dragger.prototype.handleMove_ = function(e) { | 557 goog.fx.Dragger.prototype.handleMove_ = function(e) { |
502 if (this.enabled_) { | 558 if (this.enabled_) { |
503 var dx = e.clientX - this.clientX; | 559 // dx in right-to-left cases is relative to the right. |
| 560 var sign = this.useRightPositioningForRtl_ && |
| 561 this.isRightToLeft_() ? -1 : 1; |
| 562 var dx = sign * (e.clientX - this.clientX); |
504 var dy = e.clientY - this.clientY; | 563 var dy = e.clientY - this.clientY; |
505 this.clientX = e.clientX; | 564 this.clientX = e.clientX; |
506 this.clientY = e.clientY; | 565 this.clientY = e.clientY; |
507 this.screenX = e.screenX; | 566 this.screenX = e.screenX; |
508 this.screenY = e.screenY; | 567 this.screenY = e.screenY; |
509 | 568 |
510 if (!this.dragging_) { | 569 if (!this.dragging_) { |
511 var diffX = this.startX - this.clientX; | 570 var diffX = this.startX - this.clientX; |
512 var diffY = this.startY - this.clientY; | 571 var diffY = this.startY - this.clientY; |
513 var distance = diffX * diffX + diffY * diffY; | 572 var distance = diffX * diffX + diffY * diffY; |
514 if (distance > this.hysteresisDistanceSquared_) { | 573 if (distance > this.hysteresisDistanceSquared_) { |
515 this.initializeDrag_(e); | 574 if (this.fireDragStart_(e)) { |
516 if (!this.dragging_) { | 575 this.dragging_ = true; |
517 // If the start drag is cancelled, stop trying to drag. | 576 } else { |
518 this.endDrag(e); | 577 // DragListGroup disposes of the dragger if BEFOREDRAGSTART is |
| 578 // canceled. |
| 579 if (!this.isDisposed()) { |
| 580 this.endDrag(e); |
| 581 } |
519 return; | 582 return; |
520 } | 583 } |
521 } | 584 } |
522 } | 585 } |
523 | 586 |
524 var pos = this.calculatePosition_(dx, dy); | 587 var pos = this.calculatePosition_(dx, dy); |
525 var x = pos.x; | 588 var x = pos.x; |
526 var y = pos.y; | 589 var y = pos.y; |
527 | 590 |
528 if (this.dragging_) { | 591 if (this.dragging_) { |
529 | 592 |
530 var rv = this.dispatchEvent(new goog.fx.DragEvent( | 593 var rv = this.dispatchEvent(new goog.fx.DragEvent( |
531 goog.fx.Dragger.EventType.BEFOREDRAG, this, e.clientX, e.clientY, | 594 goog.fx.Dragger.EventType.BEFOREDRAG, this, e.clientX, e.clientY, |
532 e, x, y)); | 595 e, x, y)); |
533 | 596 |
534 // Only do the defaultAction and dispatch drag event if predrag didn't | 597 // Only do the defaultAction and dispatch drag event if predrag didn't |
535 // prevent default | 598 // prevent default |
536 if (rv !== false) { | 599 if (rv) { |
537 this.doDrag(e, x, y, false); | 600 this.doDrag(e, x, y, false); |
538 e.preventDefault(); | 601 e.preventDefault(); |
539 } | 602 } |
540 } | 603 } |
541 } | 604 } |
542 }; | 605 }; |
543 | 606 |
544 | 607 |
545 /** | 608 /** |
546 * Calculates the drag position. | 609 * Calculates the drag position. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 var minY = top != null ? top : -Infinity; | 688 var minY = top != null ? top : -Infinity; |
626 return Math.min(maxY, Math.max(minY, y)); | 689 return Math.min(maxY, Math.max(minY, y)); |
627 }; | 690 }; |
628 | 691 |
629 | 692 |
630 /** | 693 /** |
631 * Overridable function for handling the default action of the drag behaviour. | 694 * Overridable function for handling the default action of the drag behaviour. |
632 * Normally this is simply moving the element to x,y though in some cases it | 695 * Normally this is simply moving the element to x,y though in some cases it |
633 * might be used to resize the layer. This is basically a shortcut to | 696 * might be used to resize the layer. This is basically a shortcut to |
634 * implementing a default ondrag event handler. | 697 * implementing a default ondrag event handler. |
635 * @param {number} x X-coordinate for target element. | 698 * @param {number} x X-coordinate for target element. In right-to-left, x this |
| 699 * is the number of pixels the target should be moved to from the right. |
636 * @param {number} y Y-coordinate for target element. | 700 * @param {number} y Y-coordinate for target element. |
637 */ | 701 */ |
638 goog.fx.Dragger.prototype.defaultAction = function(x, y) { | 702 goog.fx.Dragger.prototype.defaultAction = function(x, y) { |
639 this.target.style.left = x + 'px'; | 703 if (this.useRightPositioningForRtl_ && this.isRightToLeft_()) { |
| 704 this.target.style.right = x + 'px'; |
| 705 } else { |
| 706 this.target.style.left = x + 'px'; |
| 707 } |
640 this.target.style.top = y + 'px'; | 708 this.target.style.top = y + 'px'; |
| 709 }; |
| 710 |
| 711 |
| 712 /** |
| 713 * @return {boolean} Whether the dragger is currently in the midst of a drag. |
| 714 */ |
| 715 goog.fx.Dragger.prototype.isDragging = function() { |
| 716 return this.dragging_; |
641 }; | 717 }; |
642 | 718 |
643 | 719 |
644 | 720 |
645 /** | 721 /** |
646 * Object representing a drag event | 722 * Object representing a drag event |
647 * @param {string} type Event type. | 723 * @param {string} type Event type. |
648 * @param {goog.fx.Dragger} dragobj Drag object initiating event. | 724 * @param {goog.fx.Dragger} dragobj Drag object initiating event. |
649 * @param {number} clientX X-coordinate relative to the viewport. | 725 * @param {number} clientX X-coordinate relative to the viewport. |
650 * @param {number} clientY Y-coordinate relative to the viewport. | 726 * @param {number} clientY Y-coordinate relative to the viewport. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 * event on FireFox when user drags the mouse out of the window, 2) with | 780 * event on FireFox when user drags the mouse out of the window, 2) with |
705 * drag END event on IE7 which is generated on MOUSEMOVE event when user | 781 * drag END event on IE7 which is generated on MOUSEMOVE event when user |
706 * moves the mouse into the document after the mouse button has been | 782 * moves the mouse into the document after the mouse button has been |
707 * released, 3) when TOUCHCANCEL is raised instead of TOUCHEND (on touch | 783 * released, 3) when TOUCHCANCEL is raised instead of TOUCHEND (on touch |
708 * events). | 784 * events). |
709 * @type {boolean} | 785 * @type {boolean} |
710 */ | 786 */ |
711 this.dragCanceled = !!opt_dragCanceled; | 787 this.dragCanceled = !!opt_dragCanceled; |
712 }; | 788 }; |
713 goog.inherits(goog.fx.DragEvent, goog.events.Event); | 789 goog.inherits(goog.fx.DragEvent, goog.events.Event); |
LEFT | RIGHT |