adding amd module loader - #1078
Open
vrkansagara wants to merge 2 commits into
Open
Conversation
Author
|
@bytestream Can you review this, as I already tried to test in amd module but this is not wokring for me
|
Author
|
basically I treid to add into laravel way <script>
require(['jsvalidation'], function ($) {
$("<?= $validator['selector']; ?>").each(function () {
$(this).validate({
errorElement: 'div',
errorClass: 'invalid-feedback',
errorPlacement: function (error, element) {
error.insertAfter(element);
},
highlight: function (element) {
$(element).removeClass('is-valid').addClass('is-invalid'); // add the Bootstrap error class to the control group
},
<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>
ignore: "<?= $validator['ignore']; ?>",
<?php endif; ?>
unhighlight: function (element) {
$(element).removeClass('is-invalid').addClass('is-valid');
},
success: function (element) {
$(element).removeClass('is-invalid').addClass('is-valid'); // remove the Boostrap error class from the control group
},
focusInvalid: true,
<?php if (Config::get('jsvalidation.focus_on_error')): ?>
invalidHandler: function (form, validator) {
if (!validator.numberOfInvalids())
return;
$('html, body').animate({
scrollTop: $(validator.errorList[0].element).offset().top
}, <?= Config::get('jsvalidation.duration_animate') ?>);
},
<?php endif; ?>
rules: <?= json_encode($validator['rules']); ?>
});
});
});
</script>
` |
Author
Author
|
@bytestream Would you like to guide or make correction if any here, this will be great help to fix AMD module loader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
What does this achieve?
Is it necessary to merge into core or can it be overridden using existing features?