Comparing version 1.0.0-beta.10 to 1.0.0-beta.11
@@ -1420,4 +1420,15 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
EmbedBlot.prototype.format = function (name, value) { | ||
// Do nothing by default | ||
// super.formatAt wraps, which is what we want in general, | ||
// but this allows subclasses to overwrite for formats | ||
// that just apply to particular embeds | ||
_super.prototype.formatAt.call(this, 0, this.length(), name, value); | ||
}; | ||
EmbedBlot.prototype.formatAt = function (index, length, name, value) { | ||
if (index === 0 && length === this.length()) { | ||
this.format(name, value); | ||
} | ||
else { | ||
_super.prototype.formatAt.call(this, index, length, name, value); | ||
} | ||
}; | ||
EmbedBlot.prototype.formats = function () { | ||
@@ -1424,0 +1435,0 @@ return this.statics.formats(this.domNode); |
{ | ||
"name": "parchment", | ||
"version": "1.0.0-beta.10", | ||
"version": "1.0.0-beta.11", | ||
"description": "A document model for rich text editors", | ||
@@ -5,0 +5,0 @@ "author": "Jason Chen <jhchen7@gmail.com>", |
@@ -11,5 +11,16 @@ import { Formattable } from './abstract/blot'; | ||
format(name: string, value: any): void { | ||
// Do nothing by default | ||
// super.formatAt wraps, which is what we want in general, | ||
// but this allows subclasses to overwrite for formats | ||
// that just apply to particular embeds | ||
super.formatAt(0, this.length(), name, value); | ||
} | ||
formatAt(index: number, length: number, name: string, value: any): void { | ||
if (index === 0 && length === this.length()) { | ||
this.format(name, value); | ||
} else { | ||
super.formatAt(index, length, name, value); | ||
} | ||
} | ||
formats(): { [index: string]: any } { | ||
@@ -16,0 +27,0 @@ return this.statics.formats(this.domNode); |
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
162464
2710