diff src/plugins/undo.js @ 29:ea32a44b5a6e

remove more oo
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 11 Aug 2022 19:54:03 -0600
parents b7725dab7482
children
line wrap: on
line diff
--- a/src/plugins/undo.js	Thu Aug 11 00:04:48 2022 -0600
+++ b/src/plugins/undo.js	Thu Aug 11 19:54:03 2022 -0600
@@ -2,7 +2,7 @@
 	'use strict';
 
 	sceditor.plugins.undo = function () {
-		var base = this;
+		var base = {};
 		var sourceEditor;
 		var editor;
 		var body;
@@ -110,11 +110,8 @@
 				editor.getBody().innerHTML;
 		}
 
-		base.init = function () {
-			// The this variable will be set to the instance of the editor
-			// calling it, hence why the plugins "this" is saved to the base
-			// variable.
-			editor = this;
+		base.init = function (ed) {
+			editor = ed;
 
 			undoLimit = editor.undoLimit || undoLimit;
 
@@ -358,5 +355,7 @@
 			}
 			return node;
 		}
+
+		return base;
 	};
 }(sceditor));