Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 2b0adc0

Browse files
GoGoCarllinkesch
authored andcommitted
Restore original options editor on core init (#423)
* Restore original options editor on core init When initializing core, as a workaround, options.editor is. temporarily set to null for copying purposes, but does not. set it back. This results in unexpected modification of the. passed param and also makes the editor null for subsequent. usages. Restored the parameter's editor back after copy. * Correct a use case for null options * Code formatting to include braces
1 parent 3ff2b65 commit 2b0adc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/js/core.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
}
5252
this.options = $.extend(true, {}, defaults, options);
5353
this.options.editor = editor;
54+
if (options) {
55+
options.editor = editor; // Restore original object definition
56+
}
5457

5558
this._defaults = defaults;
5659
this._name = pluginName;

0 commit comments

Comments
 (0)