corvée(dépendances) ajoute Carbon Fields
This commit is contained in:
parent
135cc65eed
commit
62368587e5
459 changed files with 72750 additions and 26 deletions
52
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/theme-options/index.js
vendored
Normal file
52
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/theme-options/index.js
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* External dependencies.
|
||||
*/
|
||||
import { addFilter } from '@wordpress/hooks';
|
||||
import { withEffects } from 'refract-callbag';
|
||||
import { map, pipe } from 'callbag-basics';
|
||||
import fromEvent from 'callbag-from-event';
|
||||
|
||||
/**
|
||||
* Internal dependencies.
|
||||
*/
|
||||
import './style.scss';
|
||||
|
||||
/**
|
||||
* The function that controls the stream of side effects.
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
function aperture() {
|
||||
return pipe(
|
||||
fromEvent( window, 'scroll' ),
|
||||
map( () => window.jQuery( window ).scrollTop() )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The function that causes the side effects.
|
||||
*
|
||||
* @param {Object} props
|
||||
* @return {Function}
|
||||
*/
|
||||
function handler() {
|
||||
return function( windowTopOffset ) {
|
||||
const $container = window.jQuery( '.carbon-box:first' );
|
||||
const $panel = window.jQuery( '#postbox-container-1' );
|
||||
const $bar = window.jQuery( '#wpadminbar' );
|
||||
|
||||
const offset = $bar.height() + 10;
|
||||
const threshold = $container.offset().top - offset;
|
||||
|
||||
// In some situations the threshold is negative number because
|
||||
// the container element isn't rendered yet.
|
||||
if ( threshold > 0 ) {
|
||||
$panel
|
||||
.toggleClass( 'fixed', windowTopOffset >= threshold )
|
||||
.css( 'top', offset );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
addFilter( 'carbon-fields.theme_options.classic', 'carbon-fields/metaboxes', withEffects( aperture, { handler } ) );
|
||||
|
||||
10
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/theme-options/style.scss
vendored
Normal file
10
web/vendor/htmlburger/carbon-fields/packages/metaboxes/containers/theme-options/style.scss
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* ==========================================================================
|
||||
Theme Options
|
||||
========================================================================== */
|
||||
|
||||
#postbox-container-1.fixed {
|
||||
.carbon-theme-options #post-body.columns-2 &,
|
||||
.carbon-network #post-body.columns-2 & {
|
||||
position: fixed; right: 0; margin-right: 20px;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue