Skip to content

Commit

Permalink
Updated jQuery function wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Aug 6, 2022
1 parent 9bcd3ff commit ecaa22b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ gulp.task('build:js:admin', function () {
.js.pipe(concat(name + '.min.js'));
if (jQuery) {
ret = ret
.pipe(
inject.prepend(
'jQuery( document ).ready( function( $ ) {\n'
)
)
.pipe(inject.prepend('jQuery( function( $ ) {\n'))
.pipe(inject.append('} );\n'));
}
return ret.pipe(terser()).pipe(gulp.dest('dist/admin/js/'));
Expand All @@ -156,11 +152,7 @@ gulp.task('build:js:frontend', function () {
.js.pipe(concat(name + '.min.js'));
if (jQuery) {
ret = ret
.pipe(
inject.prepend(
'jQuery( document ).ready( function( $ ) {\n'
)
)
.pipe(inject.prepend('jQuery( function( $ ) {\n'))
.pipe(inject.append('} );\n'));
}
return ret.pipe(terser()).pipe(gulp.dest('dist/frontend/js/'));
Expand Down
2 changes: 1 addition & 1 deletion src/ts/admin/root_selection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jQuery(document).ready(function ($) {
jQuery(function ($) {
let path: Array<string> = sgdgRootpathLocalize.root_dir;

function resetWarn(message: string): void {
Expand Down
2 changes: 1 addition & 1 deletion src/ts/admin/tinymce.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jQuery(document).ready(function ($) {
jQuery(function ($) {
let path: Array<string> = [];

function tinymceSubmit(): void {
Expand Down

0 comments on commit ecaa22b

Please sign in to comment.