Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/cloudinary.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions php/ui/component/class-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ class Page extends Panel {
*/
protected $blueprint = 'wrap|header/|tabs/|form|notice/|body|/body|settings/|/form|/wrap';

/**
* Filter the wrap parts structure.
*
* @param array $struct The array structure.
*
* @return array
*/
protected function wrap( $struct ) {
static $added = null;

if ( empty( $added ) ) {
$struct['attributes']['id'] = 'cloudinary-settings-page';
$added = true;
}

return parent::wrap( $struct );
}

/**
* Filter the form parts structure.
*
Expand Down
9 changes: 7 additions & 2 deletions src/js/components/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ const UI = {
}
},
};
// Init.
window.addEventListener( 'load', UI._init( document ) );

const context = document.getElementById( 'cloudinary-settings-page' );

if ( context ) {
// Init.
window.addEventListener( 'load', UI._init( context ) );
}

export default UI;