# all files / Github/diagram-js/lib/util/ Cursor.js

75% Statements 6/8
100% Branches 2/2
66.67% Functions 2/3
75% Lines 6/8

    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

    1×

    229×

    229×

    229×
    94×

    135×

     import {
      classes as domClasses
    } from 'min-dom';

    var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;

    export function set(mode) {
      var classes = domClasses(document.body);

      classes.removeMatching(CURSOR_CLS_PATTERN);

      if (mode) {
        classes.add('djs-cursor-' + mode);
      }
    }

    export function unset() {
      set(null);
    }

    export function has(mode) {
      var classes = domClasses(document.body);

      return classes.has('djs-cursor-' + mode);
    }