Skip to content

Commit a1f9524

Browse files
authored
Merge pull request #26 from dss-web/scroll/to
feat: Release version 2.2.1 with fixes and enhancements
2 parents 25b1f8e + 20d598a commit a1f9524

11 files changed

Lines changed: 31 additions & 13 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 2.2.1
4+
5+
* **FIX**: Fix grid view not working in editor and frontend by properly configuring CSS file references
6+
* **FIX**: Add grid styles to editor.scss to ensure grid layout works in WordPress block editor
7+
* **ENHANCEMENT**: Update webpack configuration to build editor and style CSS separately
8+
* **ENHANCEMENT**: Improve pagination scroll behavior to position 2em above block for better user experience
9+
310
## 2.2.0
411

512
* **NEW**: Add frontend pagination support with AJAX loading

build/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 2,
44
"name": "dss/jobbnorge",
5-
"version": "2.2.0",
5+
"version": "2.2.1",
66
"title": "Jobbnorge",
77
"category": "widgets",
88
"icon": "people",

build/init.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '7c82361092d9d86c438b');
1+
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '61f15486ca2a09f57b75');

build/init.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/pagination.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array(), 'version' => '56079d1585ce2446b104');
1+
<?php return array('dependencies' => array(), 'version' => '09b126faf8a7661ac618');

build/pagination.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jobbnorge-block",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Jobbnorge Block for WordPress Gutenberg",
55
"author": "Per Søderlind <per@soderlind.no>",
66
"license": "GPL-2.0-or-later",

readme.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: block
44
Tested up to: 6.8
55
Requires at least: 6.5
66
Requires PHP: 8.2
7-
Stable tag: 2.2.0
7+
Stable tag: 2.2.1
88
License: GPL-2.0-or-later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -103,6 +103,13 @@ You get it from your Jobbnorge contact.
103103

104104
== Changelog ==
105105

106+
= 2.2.1 =
107+
108+
* FIX: Fix grid view not working in editor and frontend by properly configuring CSS file references
109+
* FIX: Add grid styles to editor.scss to ensure grid layout works in WordPress block editor
110+
* ENHANCEMENT: Update webpack configuration to build editor and style CSS separately
111+
* ENHANCEMENT: Improve pagination scroll behavior to position 2em above block for better user experience
112+
106113
= 2.2.0 =
107114

108115
* NEW: Add frontend pagination support with AJAX loading

src/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 2,
44
"name": "dss/jobbnorge",
5-
"version": "2.2.0",
5+
"version": "2.2.1",
66
"title": "Jobbnorge",
77
"category": "widgets",
88
"icon": "people",

src/pagination.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@
9797
// Reinitialize pagination for the new content
9898
initializePagination();
9999

100-
// Scroll to top of block
101-
container.scrollIntoView({
102-
behavior: 'smooth',
103-
block: 'start'
100+
// Scroll to 2em above the top of the block
101+
const containerRect = container.getBoundingClientRect();
102+
const twoEm = parseFloat(getComputedStyle(document.documentElement).fontSize) * 2;
103+
const targetPosition = window.pageYOffset + containerRect.top - twoEm;
104+
105+
window.scrollTo({
106+
top: targetPosition,
107+
behavior: 'smooth'
104108
});
105109

106110
// Update URL with page parameter (optional)

0 commit comments

Comments
 (0)