Change image storage to use new ExtendedAttrs payload field.
This commit is contained in:
@@ -115,6 +115,7 @@ export interface IExtendedAttrs {
|
||||
underlineColor: number;
|
||||
underlineVariantOffset: number;
|
||||
urlId: number;
|
||||
payload: Object | undefined;
|
||||
clone(): IExtendedAttrs;
|
||||
isEmpty(): boolean;
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ export class AttributeData implements IAttributeData {
|
||||
*/
|
||||
export class ExtendedAttrs implements IExtendedAttrs {
|
||||
private _ext: number = 0;
|
||||
public payload: Object | undefined;
|
||||
public get ext(): number {
|
||||
if (this._urlId) {
|
||||
return (
|
||||
@@ -206,6 +207,6 @@ export class ExtendedAttrs implements IExtendedAttrs {
|
||||
* that needs to be persistant in the buffer.
|
||||
*/
|
||||
public isEmpty(): boolean {
|
||||
return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;
|
||||
return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.payload === undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user