Opened 11 years ago

Closed 11 years ago

#8617 closed feature (duplicate)

dragging on right click ( reopened ticket 6909 )

Reported by: [email protected] Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.mouse Version: 1.8.24
Keywords: Cc:
Blocked by: Blocking:

Description

I reopened this ticket http://bugs.jqueryui.com/ticket/6909

Using the "which" option to target a specific mouse button. like in this example http://threedubmedia.com/code/event/drag/demo/which

$(myDIv).draggable({distance: 5, zIndex: 2700,which:3});

it is related to this jquery.ui.mouse.js

_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		// TODO: figure out why we have to use originalEvent
		event.originalEvent = event.originalEvent || {};
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1), '''<--- Add support to specify this'''
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

Change History (2)

comment:1 Changed 11 years ago by [email protected]

I made some changes, and it started working!

in widget "ui.mouse"in deafult options i added option "which:1"

options:{cancel:":input,option",distance:1,delay:0,which:1}

and in function _mouseDown changed to read this option

btnIsLeft = (event.which == this.options.which) // instead of this (event.which == 1)

comment:2 Changed 11 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #6909.

Note: See TracTickets for help on using tickets.