// Generated by CoffeeScript 1.4.0
var activitySwitchEffect,
  __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

activitySwitchEffect = {
  duration: animationTime(250)
};

effects.currentActivityChanged.connect(function(activity) {
  return effects.stackingOrder.map(function(client) {
    var activities;
    activities = client.activities;
    if (__indexOf.call(activities, activity) >= 0 && client.visible) {
      animate({
        window: client,
        animations: [
          {
            type: Effect.Opacity,
            duration: activitySwitchEffect.duration,
            from: 0,
            to: 1
          }
        ]
      });
      return animate({
        window: client,
        animations: [
          {
            type: Effect.Scale,
            duration: activitySwitchEffect.duration,
            curve: QEasingCurve.OutCubic,
            from: 0
          }
        ]
      });
    }
  });
});
