code: function endSelection() {
            var rng = doc.selection.createRange();
  
            // If the range is collapsed then use the last start range
            if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) {
              startRng.select();
            }
  
            dom.unbind(doc, 'mouseup', endSelection);
            dom.unbind(doc, 'mousemove', selectionChange);
            startRng = started = 0;
          }
docs: Removes listeners