prosemirror-history
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -96,3 +96,3 @@ 'use strict'; | ||
Branch.prototype.addTransform = function addTransform (transform, selection, histOptions, preserveItems) { | ||
var newItems = [], eventCount = this.eventCount + (selection ? 1 : 0); | ||
var newItems = [], eventCount = this.eventCount; | ||
var oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null; | ||
@@ -109,3 +109,6 @@ | ||
newItems.push(item); | ||
selection = null; | ||
if (selection) { | ||
eventCount++; | ||
selection = null; | ||
} | ||
if (!preserveItems) { lastItem = item; } | ||
@@ -112,0 +115,0 @@ } |
{ | ||
"name": "prosemirror-history", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Undo history for ProseMirror", | ||
@@ -5,0 +5,0 @@ "main": "dist/history.js", |
@@ -89,3 +89,3 @@ import RopeSequence from "rope-sequence" | ||
addTransform(transform, selection, histOptions, preserveItems) { | ||
let newItems = [], eventCount = this.eventCount + (selection ? 1 : 0) | ||
let newItems = [], eventCount = this.eventCount | ||
let oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null | ||
@@ -102,3 +102,6 @@ | ||
newItems.push(item) | ||
selection = null | ||
if (selection) { | ||
eventCount++ | ||
selection = null | ||
} | ||
if (!preserveItems) lastItem = item | ||
@@ -105,0 +108,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70131
11
767