"use strict";

angular.module('arethusa.core').service('editors', [
  'User',
  function(User) {
    var self = this;

    this.perDocument = {};

    this.addEditor = function(docId, editor) {
      var doc = self.perDocument[docId];
      if (!doc) doc = self.perDocument[docId] = [];
      doc.push(new User(editor));
    };
  }
]);

"use strict";

angular.module('arethusa.core').service('editors', [
  'User',
  function(User) {
    var self = this;

    this.perDocument = {};

    this.addEditor = function(docId, editor) {
      var doc = self.perDocument[docId];
      if (!doc) doc = self.perDocument[docId] = [];
      doc.push(new User(editor));
      self.present = true;
    };

    this.editorsPresent = false;
  }
]);

Make known when editors are present in editors