diff --git a/platform/search/bundle.js b/platform/search/bundle.js index 74040b84f4..fb5714fab6 100644 --- a/platform/search/bundle.js +++ b/platform/search/bundle.js @@ -103,7 +103,6 @@ define([ "type": "provider", "implementation": GenericSearchProvider, "depends": [ - "$timeout", "$q", "$log", "modelService", diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index ce2ae642ed..fbe45ae6d8 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -19,6 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +/*global setTimeout*/ /** * Module defining GenericSearchProvider. Created by shale on 07/16/2015. @@ -41,9 +42,8 @@ define([ * @param {TopicService} topic the topic service. * @param {Array} ROOTS An array of object Ids to begin indexing. */ - function GenericSearchProvider($timeout, $q, $log, modelService, workerService, topic, ROOTS) { + function GenericSearchProvider($q, $log, modelService, workerService, topic, ROOTS) { var provider = this; - this.$timeout = $timeout; this.$q = $q; this.$log = $log; this.modelService = modelService; @@ -193,8 +193,7 @@ define([ */ GenericSearchProvider.prototype.beginIndexRequest = function () { var idToIndex = this.idsToIndex.shift(), - provider = this, - $timeout = this.$timeout; + provider = this; this.pendingRequests += 1; this.modelService @@ -210,10 +209,10 @@ define([ .warn('Failed to index domain object ' + idToIndex); }) .then(function () { - $timeout(function () { + setTimeout(function () { provider.pendingRequests -= 1; provider.keepIndexing(); - }, 0, false); + }, 0); }); }; diff --git a/platform/search/test/services/GenericSearchProviderSpec.js b/platform/search/test/services/GenericSearchProviderSpec.js index c9fc1ff03d..abfe3d011d 100644 --- a/platform/search/test/services/GenericSearchProviderSpec.js +++ b/platform/search/test/services/GenericSearchProviderSpec.js @@ -30,8 +30,7 @@ define([ ) { describe('GenericSearchProvider', function () { - var $timeout, - $q, + var $q, $log, modelService, models, @@ -43,7 +42,6 @@ define([ provider; beforeEach(function () { - $timeout = jasmine.createSpy('$timeout'); $q = jasmine.createSpyObj( '$q', ['defer'] @@ -82,12 +80,7 @@ define([ spyOn(GenericSearchProvider.prototype, 'scheduleForIndexing'); - $timeout.andCallFake(function (callback, millis) { - window.setTimeout(callback, millis); - }); - provider = new GenericSearchProvider( - $timeout, $q, $log, modelService,