Closed domchristie closed 7 years ago
Cool, it's up to you how you want to proceed - if it has similar features / browser support I'd wouldn't be opposed to taking the changes into master on this repo but don't have any problem if you'd rather start it as a new project. I'm curious - what's the approach for the new version?
Thanks!
I'm curious - what's the approach for the new version?
A summary of the differences:
new Expanding(textarea)
expanding:update
as custom, native, namespaced events cannot be bound in jQuery (i.e. it is not possible to do: $(document).on('update.expanding')
)describe
/ context
/ it
approachThe file structure is as follows:
dist/
expanding.js
src/
expanding.js
helpers.js
textarea-clone.js
textarea.js
test/
lib/
chai.js
mocha.css
mocha.js
sinon.js
expanding-test.js
index.html
integration-test.js
textarea-clone-test.js
textarea-test.js
I started writing this with a pull request in mind, but wonder if the diff might be a little difficult to review?
The diff might be hard to review but feel free to send it over and we'll see what it ends up looking like.
What do you think about keeping a jQuery plugin registration that just calls out to new Expanding(textarea)
to keep backwards compat?
OK, cool. I'll try and get something together that makes a bit more sense, perhaps by rewriting some of the internal methods to use vanilla JS/DOM.
Re: keeping the jQuery plugin, yeh sounds good, and it is kind of what we're doing already. There is a bit of jQuery code to prevent the plugin from being reinitialised, but it should be fairly straightforward.
@bgrins I have been working on a version of this idea which does not depend on jQuery. It takes quite a different approach, but uses some of the ideas present in this repo.
Would you be happy for me to start a new repo with this new code and publish it to NPM?