From 9fec6f6613f8b65530632bc9ac18c854ac3dc787 Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 21 Apr 2016 11:21:11 -0700 Subject: [PATCH] Don't break jQuery-UI autocomplete with algolia's --- app/views/teachers/ConvertToTeacherAccountView.coffee | 2 +- app/views/teachers/CreateTeacherAccountView.coffee | 2 +- app/views/teachers/RequestQuoteView.coffee | 2 +- bower.json | 6 +++++- config.coffee | 4 +++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/teachers/ConvertToTeacherAccountView.coffee b/app/views/teachers/ConvertToTeacherAccountView.coffee index a82be6956..096ac7607 100644 --- a/app/views/teachers/ConvertToTeacherAccountView.coffee +++ b/app/views/teachers/ConvertToTeacherAccountView.coffee @@ -61,7 +61,7 @@ module.exports = class ConvertToTeacherAccountView extends RootView @$('#other-education-level-checkbox').attr('checked', !!otherLevel) @$('#other-education-level-input').val(otherLevel) - $("#organization-control").autocomplete({hint: false}, [ + $("#organization-control").algolia_autocomplete({hint: false}, [ source: (query, callback) -> algolia.schoolsIndex.search(query, { hitsPerPage: 5, aroundLatLngViaIP: false }).then (answer) -> callback answer.hits diff --git a/app/views/teachers/CreateTeacherAccountView.coffee b/app/views/teachers/CreateTeacherAccountView.coffee index 0b80fe9b2..59be15e5a 100644 --- a/app/views/teachers/CreateTeacherAccountView.coffee +++ b/app/views/teachers/CreateTeacherAccountView.coffee @@ -60,7 +60,7 @@ module.exports = class CreateTeacherAccountView extends RootView @$('#other-education-level-checkbox').attr('checked', !!otherLevel) @$('#other-education-level-input').val(otherLevel) - $("#organization-control").autocomplete({hint: false}, [ + $("#organization-control").algolia_autocomplete({hint: false}, [ source: (query, callback) -> algolia.schoolsIndex.search(query, { hitsPerPage: 5, aroundLatLngViaIP: false }).then (answer) -> callback answer.hits diff --git a/app/views/teachers/RequestQuoteView.coffee b/app/views/teachers/RequestQuoteView.coffee index 915694d22..bb18ce945 100644 --- a/app/views/teachers/RequestQuoteView.coffee +++ b/app/views/teachers/RequestQuoteView.coffee @@ -63,7 +63,7 @@ module.exports = class RequestQuoteView extends RootView @$('#other-education-level-checkbox').attr('checked', !!otherLevel) @$('#other-education-level-input').val(otherLevel) - $("#organization-control").autocomplete({hint: false}, [ + $("#organization-control").algolia_autocomplete({hint: false}, [ source: (query, callback) -> algolia.schoolsIndex.search(query, { hitsPerPage: 5, aroundLatLngViaIP: false }).then (answer) -> callback answer.hits diff --git a/bower.json b/bower.json index 46ec14996..2a24feca4 100644 --- a/bower.json +++ b/bower.json @@ -51,12 +51,16 @@ "lscache": "~1.0.5", "esper.js": "http://files.codecombat.com/esper.tar.gz", "algoliasearch": "^3.13.1", - "algolia-autocomplete.js": "^1.17.0" + "algolia-autocomplete.js": "^1.17.0", + "algolia-autocomplete-no-conflict": "1.0.0" }, "overrides": { "algolia-autocomplete.js": { "main": "dist/autocomplete.jquery.js" }, + "algolia-autocomplete-no-conflict": { + "main": "no-conflict.js" + }, "backbone": { "main": "backbone.js" }, diff --git a/config.coffee b/config.coffee index 2b26d3f61..369dd2049 100644 --- a/config.coffee +++ b/config.coffee @@ -165,7 +165,9 @@ exports.config = 'vendor/scripts/async.js' 'vendor/scripts/jquery-ui-1.11.1.js.custom.js' ] - + after: [ + 'bower_components/algolia-autocomplete-no-conflict/no-conflict.js' + ] stylesheets: defaultExtension: 'sass' joinTo: