documentcloud / visualsearch

A Rich Search Box for Real Data
http://documentcloud.github.io/visualsearch/
MIT License
1.8k stars 225 forks source link

Add support to newer jquery versions #86

Closed blittle closed 11 years ago

blittle commented 11 years ago

This is an attempt to fix compatibility issues with the newer versions of jquery in issue #85.

blittle commented 11 years ago

This should probably be changed from:

if (autoCompleteData['value'] == box.val()) {
  //box.data('autocomplete').menu.activate(new $.Event("mouseover"), $value);
}

to:

if (autoCompleteData['value'] == box.val() && box.data('autocomplete').menu.activate) {
  box.data('autocomplete').menu.activate(new $.Event("mouseover"), $value);
}
fdaugan commented 11 years ago

This patch works for me (1.9.2). Thanks a lot.

flipdoubt commented 11 years ago

Is this available to download somewhere? I followed the links to the blittle repository but could not find a branch where the jQuery file names changed. I still don't get git and don't trust my understanding to apply the patch and produce something that should work.

blittle commented 11 years ago

If you look in my fork, the built js files are updated to support jQuery 1.9 although the actual dependencies.js file still is jQuery 1.6.1.

Download visualsearch.js and visualsearch.css at https://github.com/blittle/visualsearch/tree/master/build

flipdoubt commented 11 years ago

That does work for us. Thank you very much.

mattbrun commented 11 years ago

Just found your patch after resolving the _renderItemData() bug by myself... Anyway, thanks a lot for your work. Your pull request works like a charm for me with jQuery 1.8.3 and jQuery UI 1.9.2 :)

tomaswitek commented 11 years ago

Hi, the patch works fine with new jquery version, but witch older one I am getting this error: Uncaught TypeError: Object # has no method '_renderItemData' How did you fix this? Thx

blittle commented 11 years ago

@tomaswitek Which version of jQuery and jQuery UI are you running it with?

tomaswitek commented 11 years ago

jQuery JavaScript Library v1.8.3, jQuery UI 1.8.24. With this version I have a problem. But when I run jQuery UI Core 1.9.2 everything is OK.

blittle commented 11 years ago

@tomaswitek I just pushed a fix for this bug, download the latest https://github.com/blittle/visualsearch/blob/master/build/visualsearch.js

Let me know if you see other problems.

samuelclay commented 11 years ago

Does this patch work on the older version of jQuery UI (1.8)? I noticed you removed a preventDefault, which might have unintended consequences for the older jQuery UI.

blittle commented 11 years ago

@samuelclay As far as I have been able to tell, everything is working fine in jQuery UI v1.8.24. I haven't extensively tested different versions and combinations on jQuery and jQuery UI. Please let me know if you see any problems.

tomaswitek commented 11 years ago

@blittle works great in all versions I tested. Thanks. Great work ;)