/* global define */

define([
  'jquery',
  'underscore',
  'buses/command-bus',
  'buses/event-bus'
], function ($, _, CommandBus, EventBus) {
  'use strict';

  CommandBus.setHandler('when:fetched', function (entities, done, fail) {
    var xhrs = _.chain([entities])
                .flatten()
                .pluck('fetch')
                .map(function (xhr, index) {
                  return xhr.call(entities[index], { reset: true });
                })
                .value();

    EventBus.trigger('disable:controls');
    $.when.apply($, xhrs).done(function (collection, status, jqXHR) {
      done(collection, status, jqXHR);
      EventBus.trigger('enable:controls');
    }).fail(function () {
      fail();
      EventBus.trigger('enable:controls');
    });
  });
});
@@ -508,24 +508,19 @@
 er('
-disable:controls
+fetch:start
 ');%0A
@@ -585,24 +585,62 @@
 s, jqXHR) %7B%0A
+      EventBus.trigger('fetch:done');%0A
       done(c
@@ -670,51 +670,8 @@
 R);%0A
-      EventBus.trigger('enable:controls');%0A
     
@@ -696,22 +696,8 @@
 ) %7B%0A
-      fail();%0A
     
@@ -720,24 +720,33 @@
 er('
-enable:controls'
+fetch:fail');%0A      fail(
 );%0A 

Change events when fetching models/collections