Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix when link_to_remove contain html #7

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A vanilla JS replacement for (Rails) [Cocoon](https://github.com/nathanvda/cocoo
Run:

```
yarn add @kollegorna/cocoon-vanilla-js
yarn add @Belibaste/cocoon-vanilla-js
```

Import as ES6 module:
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const removeFieldsHandler = (btn) => {
nodeToDelete.parentNode.removeChild(nodeToDelete);
}
else {
const input = btn.previousElementSibling;
const input = nodeToDelete.querySelector('input[type=hidden][name*="[_destroy]"');
if(input && input.matches('input[type=hidden]')) {
input.value = 1;
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@kollegorna/cocoon-vanilla-js",
"name": "@Belibaste/cocoon-vanilla-js",
"version": "1.0.3",
"description": "A vanilla JS replacement for (Rails) Cocoon's jQuery script",
"main": "index.js",
"engines": {
"node": "<=9.11.2"
},
"repository": "git+https://github.com/kollegorna/cocoon-vanilla-js.git",
"repository": "git+https://github.com/Belibaste/cocoon-vanilla-js.git",
"author": "Kollegorna",
"license": "MIT",
"bugs": {
"url": "https://github.com/kollegorna/cocoon-vanilla-js/issues"
"url": "https://github.com/Belibaste/cocoon-vanilla-js/issues"
},
"homepage": "https://github.com/kollegorna/cocoon-vanilla-js#readme",
"homepage": "https://github.com/Belibaste/cocoon-vanilla-js#readme",
"devDependencies": {},
"dependencies": {}
}
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# yarn lockfile v1


"js-utils@git+https://8265015e18616ae2d58e38f4fd9ca111b8beaff8:x-oauth-basic@github.com/kollegorna/js-utils.git#6507589":
"js-utils@git+https://8265015e18616ae2d58e38f4fd9ca111b8beaff8:x-oauth-basic@github.com/Belibaste/js-utils.git#6507589":
version "1.0.0"
resolved "git+https://8265015e18616ae2d58e38f4fd9ca111b8beaff8:x-oauth-basic@github.com/kollegorna/js-utils.git#6507589ae81c91ff2db72d7c4905a3d2d52674f9"
resolved "git+https://8265015e18616ae2d58e38f4fd9ca111b8beaff8:x-oauth-basic@github.com/Belibaste/js-utils.git#6507589ae81c91ff2db72d7c4905a3d2d52674f9"