Bug Tracker

Modify

Ticket #2104 (closed bug: wontfix)

Opened 5 years ago

Last modified 14 months ago

find() does not recognize a passed DOM object instead of selector string

Reported by: torben Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

I put some effort in making interface.js v1.2 work with jQuery v1.2.x since a migration to jQ UI, unfortunately, is far from being straight forward.

A concrete problem arises from iSlider.js, which uses a .Draggable in the build() method. As 'handle' it uses 'this'. Later on, the jQ core function find() is called with 'this' in line:

var dhe = o.handle ? jQuery(this).find(o.handle) : jQuery(this);

The find() method does not return an appropriate result and execution fails with an error (at least in IE). This is because indexOf() does not work for a DOM object.

Anyway, find() needs to become more robust. I recommend trying to convert a non-string into a jQ object (see attached patch). One could argue if it is a problem of jQ or the caller (e.g. interface.js). However, I don't see a problem in falling back to a standard jQuery if the passed parameter is not a selector string.

Attachments

find-with-object-support.diff Download (513 bytes) - added by torben 5 years ago.
patch enabling fallback to standard jQ query if an object different from string is passed

Change History

Changed 5 years ago by torben

patch enabling fallback to standard jQ query if an object different from string is passed

comment:1 Changed 5 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

I don't understand what .find() with a DOM element would do? It definitely seems like Interface should do a check to see if it's a DOM element, and use jQuery(o.handle).

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.