1

The Setup

After a page finishes loading, I'm adding a _changes listener to a couchdb longpoll feed (just in case it matters, I'm using this function in the Kanso db module).

Once the listener is added, mobile Safari's loading indicator starts spinning and it doesn't stop until the listener is removed.

The Problem

This makes users think the app is constantly downloading something.

The Question

Is there any way to make mobile Safari's loading indicator spin only when a change notification is received?

If not, is there a way to completely prevent mobile Safari's loading indicator from spinning?

nrw
  • 819
  • 2
  • 7
  • 22
  • This is a difficult one to Google for. One possible clue: are you running this code from the `document.ready` event? This answer indicates that if you postpone your execution, you will avoid the "throbber of doom": http://stackoverflow.com/a/7198241/2938 – JasonSmith May 05 '12 at 23:48
  • See also http://blog.kwwika.com/?tag=throbberofdoom -- I'm not confident enough to make this an official answer. If it works for you, would you please set an answer and mark it accepted? If it doesn't... we'll keep trying I guess. – JasonSmith May 05 '12 at 23:53
  • 1
    @JasonSmith I have seen both of the posts you linked. I'm adding the changes listener long after the page has finished loading. Delaying the addition of the `_changes` listener gives the desired behavior in desktop Safari, Chrome, Firefox, and Opera. However, no matter when I add the `_changes` listener, mobile Safari starts spinning the moment the listener is added. It's rumored that an [event source](https://github.com/indutny/couchdb/commit/a152fb950bff92bc279a81570d96cb77cd71e48b) `_changes` feed won't trigger the spinner, but I proceed cautiously with an untested patch. Thoughts? – nrw May 11 '12 at 15:38
  • I saw the event source thing too. If you can get a failing test case and take that to the CouchDB list, we could merge that patch for the next release. – JasonSmith May 12 '12 at 02:33
  • Thanks. I'll see what I can come up with. – nrw May 14 '12 at 12:58

0 Answers0