# all files / diagram-js/lib/features/modeling/cmd/helper/ MoveClosure.js

100% Statements 11/11
100% Branches 0/0
100% Functions 3/3
100% Lines 11/11

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34

    589×
    589×

    589×
    589×

    589×

    1×
    13×

    1×

    1016×

    1016×

    1016×
     import {
      assign
    } from 'min-dash';

    import {
      getClosure
    } from '../../../../util/Elements';

    export default function MoveClosure() {

      this.allShapes = {};
      this.allConnections = {};

      this.enclosedElements = {};
      this.enclosedConnections = {};

      this.topLevel = {};
    }

    MoveClosure.prototype.add = function(element, isTopLevel) {
      return this.addAll([ element ], isTopLevel);
    };

    MoveClosure.prototype.addAll = function(elements, isTopLevel) {

      var newClosure = getClosure(elements, !!isTopLevel, this);

      assign(this, newClosure);

      return this;
    };