← All changes
|
assets/src/apps/js/blocks/course-elements/course-featured/index.js
+32
-32
4.3.8
→
4.4.9
View file →
| @@ -1,32 +1,32 @@ | ||
| 1 | -/** | |
| 2 | - * Register block course featured. | |
| 3 | - */ | |
| 4 | -import edit from './edit'; | |
| 5 | -import { save } from './save'; | |
| 6 | -import metadata from './block.json'; | |
| 7 | -import { registerBlockType } from '@wordpress/blocks'; | |
| 8 | -import { checkTemplatesCanLoadBlock } from '../../utilBlock.js'; | |
| 9 | - | |
| 10 | -const templatesName = [ | |
| 11 | - 'learnpress/learnpress//single-lp_course', | |
| 12 | - 'learnpress/learnpress//single-lp_course-offline', | |
| 13 | -]; | |
| 14 | - | |
| 15 | -/** | |
| 16 | - * Check if the block can load in the template editor: single-lp_course. | |
| 17 | - * if it is editing on this template, set ancestor to null | |
| 18 | - */ | |
| 19 | -checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => { | |
| 20 | - registerBlockType( metadataNew.name, { | |
| 21 | - ...metadataNew, | |
| 22 | - edit, | |
| 23 | - save, | |
| 24 | - } ); | |
| 25 | -} ); | |
| 26 | - | |
| 27 | -// Register the block with the original metadata, ancestor will be set on block.json | |
| 28 | -registerBlockType( metadata.name, { | |
| 29 | - ...metadata, | |
| 30 | - edit, | |
| 31 | - save, | |
| 32 | -} ); | |
| 1 | +/** | |
| 2 | + * Register block course featured. | |
| 3 | + */ | |
| 4 | +import edit from './edit'; | |
| 5 | +import { save } from './save'; | |
| 6 | +import metadata from './block.json'; | |
| 7 | +import { registerBlockType } from '@wordpress/blocks'; | |
| 8 | +import { checkTemplatesCanLoadBlock } from '../../utilBlock.js'; | |
| 9 | + | |
| 10 | +const templatesName = [ | |
| 11 | + 'learnpress/learnpress//single-lp_course', | |
| 12 | + 'learnpress/learnpress//single-lp_course-offline', | |
| 13 | +]; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Check if the block can load in the template editor: single-lp_course. | |
| 17 | + * if it is editing on this template, set ancestor to null | |
| 18 | + */ | |
| 19 | +checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => { | |
| 20 | + registerBlockType( metadataNew.name, { | |
| 21 | + ...metadataNew, | |
| 22 | + edit, | |
| 23 | + save, | |
| 24 | + } ); | |
| 25 | +} ); | |
| 26 | + | |
| 27 | +// Register the block with the original metadata, ancestor will be set on block.json | |
| 28 | +registerBlockType( metadata.name, { | |
| 29 | + ...metadata, | |
| 30 | + edit, | |
| 31 | + save, | |
| 32 | +} ); | |