Getting Started
Features
- API
- Blocks
- Blocks with JS
- Helper Classes
- Block Fields
- Accessing Fields
- Text Margin
- Presets
- Block Settings
- Drag & Drop Sortable
- Block Spacings
- Custom Block Stubs
- Widgets
Requirements
PHP>=8.0ProcessWire>=3.0.227RockMigrations>=3.30.0RockFrontend>=3.6.0- API
Helper Classes
The JavaScript code in assets/frontend-loggedin.js
dynamically adds and removes classes to the <body>
element based on user interactions and the state of the page. Here's a summary of the classes that are added to <body>
and under what conditions:
rpb-active:
- Added once the DOM content is fully loaded to indicate that the RockPageBuilder scripts are active and have modified the page. This is done in a DOMContentLoaded event listener at the end of the script.
.no-sortable:
- Added when the sortable functionality is disabled either through the
_RockSortable.prototype.disable
method or initially if the sortable is not enabled. - Removed when the sortable functionality is enabled through the
_RockSortable.prototype.enable
method.
- Added when the sortable functionality is disabled either through the
is-sortable:
- Added when the sortable functionality is enabled through the
_RockSortable.prototype.enable
method. - Removed when the sortable functionality is disabled through the
_RockSortable.prototype.disable
method.
- Added when the sortable functionality is enabled through the
rpb-reloading:
- Added by the
_RockSortable.prototype.showSpinner
method right before a loading spinner is displayed. This typically occurs during a page reload triggered by a successful sort operation that requires a page refresh.
- Added by the
grabbing:
- Added to indicate that an item is being dragged. It is added in the onChoose event handler of the Sortable initialization and removed in the onUnchoose event handler.
no-alfred:
- Temporarily added during a drag operation to possibly indicate a mode where certain UI elements or interactions are disabled. It is added in the onChoose event handler and removed in both the onEnd and onUnchoose event handlers if it was added by the drag operation.
These classes are used to control the appearance and functionality of the page, particularly in relation to the drag-and-drop sorting feature and the loading state indication.