diff --git a/.factory/index.js.mjs b/.factory/index.js.mjs index 88e5bec..927bc1e 100644 --- a/.factory/index.js.mjs +++ b/.factory/index.js.mjs @@ -115,10 +115,12 @@ $$.$ = function () { $$.attach = function (self, state) { let $ = this; + self = self || $.self; + state = state || $.state; $._active = true; $._value = theValue(self); $.self = self; - isSet(state) && ($.state = state); + $.state = state; // Attach event(s) for (let event in events) { onEvent(event, self, theEvent); diff --git a/index.html b/index.html index 1bd1e8e..2b8901e 100644 --- a/index.html +++ b/index.html @@ -5,13 +5,13 @@ - Text Editor 4.1.2 + Text Editor 4.1.3

Do you like this project? Please support my Mecha CMS project too. Thank you!

-

Text Editor 4.1.2

+

Text Editor 4.1.3

Text Editor is a simple JavaScript application that aims to provide accessibility enhancements to the native HTML <textarea> elements, allowing users to control and manipulate their data in the text editor as they wish. It contains very sufficient methods to manipulate the existing text selection range data without providing unnecessary features. This keeps the file size small and the learning curve low, so you can fully focus on the results.


diff --git a/index.js b/index.js index ab1c317..940ea1d 100644 --- a/index.js +++ b/index.js @@ -253,7 +253,7 @@ return current; }; }; - TextEditor.version = '4.1.2'; + TextEditor.version = '4.1.3'; TextEditor.x = x; Object.defineProperty(TextEditor, 'name', { value: 'TextEditor' @@ -278,10 +278,12 @@ }; $$.attach = function (self, state) { var $ = this; + self = self || $.self; + state = state || $.state; $._active = true; $._value = theValue(self); $.self = self; - isSet(state) && ($.state = state); + $.state = state; // Attach event(s) for (var event in events) { onEvent(event, self, theEvent); diff --git a/index.min.js b/index.min.js index 05514b2..e16f173 100644 --- a/index.min.js +++ b/index.min.js @@ -23,4 +23,4 @@ * SOFTWARE. * */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TextEditor=t()}(this,(function(){"use strict";var e=function(e,t){return-1!==t.indexOf(e)},t=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},n=function(e,t){return e&&c(t)&&e instanceof t},o=function(e){return i(e)&&0==e%1},i=function(e){return"number"==typeof e},u=function(e,t){return void 0===t&&(t=!0),"object"==typeof e&&(!t||n(e,Object))},c=function(e){return function(e){return void 0!==e}(e)&&!function(e){return null===e}(e)},a=function(e){return"string"==typeof e},s=function(e){return e.length},l=function r(){for(var n=arguments.length,o=Array(n),i=0;i current; }; -TextEditor.version = '4.1.2'; +TextEditor.version = '4.1.3'; TextEditor.x = x; @@ -115,10 +115,12 @@ $$.$ = function () { $$.attach = function (self, state) { let $ = this; + self = self || $.self; + state = state || $.state; $._active = true; $._value = theValue(self); $.self = self; - isSet(state) && ($.state = state); + $.state = state; // Attach event(s) for (let event in events) { onEvent(event, self, theEvent); diff --git a/package.json b/package.json index a51c56e..61593de 100755 --- a/package.json +++ b/package.json @@ -44,5 +44,5 @@ "scripts": { "pack": "pack --clean=false --from=.factory --js-format=umd --js-name=TextEditor --js-top='%(js.license)' --mjs=true --to=." }, - "version": "4.1.2" + "version": "4.1.3" } \ No newline at end of file