Skip to content

Commit

Permalink
fix to loading js assets
Browse files Browse the repository at this point in the history
  • Loading branch information
pattyok committed May 11, 2023
1 parent 3d5b2d7 commit 592f34e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ Makes a production ready bundle

## Other notes
Use with the GitHub Updater Plugin to install and update on sites. https://github.com/afragen/github-updater

## Releases
- 3.1.20 - 5/11/23 - Fix to galleries, slick script was not loading for the extended gallery or lightbox gallery so the gallery went missing on mobile.
4 changes: 3 additions & 1 deletion build/lightbox-gallery/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@
}
},
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css"
"editorStyle": "file:./index.css",
"viewScript": "file:./script.js",
"style": "file:./style-index.css"
}
2 changes: 1 addition & 1 deletion build/lightbox-gallery/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'c39d0a605ecbb6a182df');
<?php return array('dependencies' => array('lodash', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'f1d99bb21d315eb5c4d3');
4 changes: 2 additions & 2 deletions build/lightbox-gallery/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/lightbox-gallery/script.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('jquery'), 'version' => '5baa47c085073e7ad60d');
1 change: 1 addition & 0 deletions build/lightbox-gallery/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/lightbox-gallery/style-index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.wp-block-carkeek-blocks-lightbox-gallery ul.slick-slider{padding-left:1rem;padding-right:1rem}
2 changes: 1 addition & 1 deletion carkeek-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Primary Branch: main
* Description: Series of blocks designed to work with this site's custom Theme
* Author: Patty O'Hara
* Version: 3.1.19
* Version: 3.1.20
* Author URI https://carkeekstudios.com/
* Text Domain: carkeek-blocks
*/
Expand Down
7 changes: 7 additions & 0 deletions includes/class-carkeekblocks-register.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ public function carkeek_blocks_enqueue_global_assets() {
filemtime( "$dir/$vendor/slick.js" ),
true
);
wp_enqueue_script(
'mobile-scroll',
plugins_url( 'build/lightbox-gallery/script.js', dirname( __FILE__ ) ),
array( 'jquery', 'slick-slider' ),
filemtime( "$dir/build/lightbox-gallery/script.js" ),
true
);
}

// load shared assets for specific blocks only.
Expand Down
4 changes: 3 additions & 1 deletion src/lightbox-gallery/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@
}
},
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css"
"editorStyle": "file:./index.css",
"viewScript": "file:./script.js",
"style": "file:./style-index.css"
}
1 change: 1 addition & 0 deletions src/lightbox-gallery/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./editor.scss";
import "./style.scss";

import edit from "./edit";
import save from "./save";
Expand Down
6 changes: 6 additions & 0 deletions src/lightbox-gallery/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.wp-block-carkeek-blocks-lightbox-gallery {
& ul.slick-slider {
padding-left: 1rem;
padding-right: 1rem;
}
}

0 comments on commit 592f34e

Please sign in to comment.