Allow loader spinning icon to be toggled on or off #884

Closed
signalpoint opened this Issue Dec 9, 2016 · 1 comment

Projects

None yet

1 participant

@signalpoint
Owner

I'd like to be able to suppress the loader from showing on a particular jDrupal call, this isn't possible.

@signalpoint
Owner

Here's a simple usage example that will temporarily hide the spinner so you can make a network call in the background, without interrupting the user with the "loading..." icon. Once your call is on success, then turn the loader back on, for example:

// Temporarily disable the spinner icon.
drupalgap_loader_enable(false);

my_module_service_call({
  success: function(result) {

    // Turn the spinner back on for the next caller.
    drupalgap_loader_enable(true);

    // Everything was OK, do some custom code now
    // ...

  },
  error: function(xhr, status, msg) {

    // Turn the spinner back on for the next caller.
    drupalgap_loader_enable(true);

    // Alert the user to the problem.
    drupalgap_alert(msg);

  }
});
@signalpoint signalpoint closed this Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment