-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Move JavaScript to separate file #8205
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
Conversation
By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good idea, thanks!
reference/forms/types/collection.rst
Outdated
@@ -158,6 +158,7 @@ things are even easier because the ``data-prototype`` attribute is rendered | |||
automatically for you (with a slight difference - see note below) and all | |||
you need is the JavaScript: | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be reverted.
reference/forms/types/collection.rst
Outdated
e.preventDefault(); | ||
var list = jQuery(jQuery(this).attr('data-list')); | ||
// Try to find the counter of the list | ||
var counter = list.data('widget-counter'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var counter = list.data('widget-counter') | list.children().length;
Let's see if it's help if I try to merge to 2.8 |
I think we shouldn't be using a configuration block here, but instead show the JS file in a seperate code block. I think it's important that the JS code is visible on the screen at first sight. |
@technetium thanks for improving this code and congrats on your first Symfony Docs contribution! |
This PR was merged into the 2.8 branch. Discussion ---------- Move JavaScript to separate file By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY. Commits ------- 98b1c7b Minor tweaks 5594d7e Move JavaScript to seperate file
This PR was merged into the 2.8 branch. Discussion ---------- Move JavaScript to separate file By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY. Commits ------- 98b1c7b Minor tweaks 5594d7e Move JavaScript to seperate file
* 2.7: minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [error_pages] Removing misleading checker in code example Remove section about forms using validation Removed extra class Renamed TestedTypeTests to TestedTypeTest Add docs about the validator TypeTestCase class
* 2.8: minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [error_pages] Removing misleading checker in code example add default option value for collection type minor symfony#8831 Update collection.rst (babaorum) Move JavaScript to seperate file Remove section about forms using validation Removed extra class Renamed TestedTypeTests to TestedTypeTest Add docs about the validator TypeTestCase class
* 2.8: minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [error_pages] Removing misleading checker in code example add default option value for collection type minor symfony#8831 Update collection.rst (babaorum) Move JavaScript to seperate file Remove section about forms using validation Removed extra class Renamed TestedTypeTests to TestedTypeTest Add docs about the validator TypeTestCase class
* 3.3: (22 commits) add note about same-state transitions minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [error_pages] Removing misleading checker in code example Updated LDAP documentation for Symfony 3.1 Updating example README to match note below it Update docs for setting custom response code in exception handler add default option value for collection type minor symfony#8831 Update collection.rst (babaorum) minor symfony#8987 Fix YAML config bug (Holicz, javiereguiluz) Move JavaScript to seperate file Remove section about forms using validation Removed extra class Update fomr testing sentence Renamed TestedTypeTests to TestedTypeTest ...
* 3.4: (30 commits) add note about same-state transitions minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [Workflow] Document the new transition completed event [error_pages] Removing misleading checker in code example fix syntax errors and add some more crosslinks Updated LDAP documentation for Symfony 3.1 Updating example README to match note below it Update docs for setting custom response code in exception handler add default option value for collection type minor symfony#8831 Update collection.rst (babaorum) minor symfony#8987 Fix YAML config bug (Holicz, javiereguiluz) ...
* 4.0: (36 commits) add note about same-state transitions Corrected recipes minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz) [Workflow] Document the new transition completed event [error_pages] Removing misleading checker in code example Added the env vars in the nginx config too Commented the env vars and mentioned that they are optional fix syntax errors and add some more crosslinks Updated LDAP documentation for Symfony 3.1 Updating example README to match note below it Update docs for setting custom response code in exception handler ...
By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.