← All changes
|
assets/src/apps/js/blocks/course-elements/course-description/index.js
+31
-31
4.3.9
→
4.4.9
View file →
| @@ -1,31 +1,31 @@ | ||
| 1 | -/** | |
| 2 | - * Register block course description. | |
| 3 | - */ | |
| 4 | - | |
| 5 | -import { edit } from './edit'; | |
| 6 | -import { save } from './save'; | |
| 7 | -import metadata from './block.json'; | |
| 8 | -import { registerBlockType } from '@wordpress/blocks'; | |
| 9 | -import { checkTemplatesCanLoadBlock } from '../../utilBlock.js'; | |
| 10 | -import { postContent } from '@wordpress/icons'; | |
| 11 | - | |
| 12 | -const templatesName = [ | |
| 13 | - 'learnpress/learnpress//single-lp_course', | |
| 14 | - 'learnpress/learnpress//single-lp_course-offline', | |
| 15 | -]; | |
| 16 | - | |
| 17 | -checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => { | |
| 18 | - registerBlockType( metadataNew.name, { | |
| 19 | - ...metadataNew, | |
| 20 | - icon: postContent, | |
| 21 | - edit, | |
| 22 | - save, | |
| 23 | - } ); | |
| 24 | -} ); | |
| 25 | - | |
| 26 | -registerBlockType( metadata.name, { | |
| 27 | - ...metadata, | |
| 28 | - icon: postContent, | |
| 29 | - edit, | |
| 30 | - save, | |
| 31 | -} ); | |
| 1 | +/** | |
| 2 | + * Register block course description. | |
| 3 | + */ | |
| 4 | + | |
| 5 | +import { edit } from './edit'; | |
| 6 | +import { save } from './save'; | |
| 7 | +import metadata from './block.json'; | |
| 8 | +import { registerBlockType } from '@wordpress/blocks'; | |
| 9 | +import { checkTemplatesCanLoadBlock } from '../../utilBlock.js'; | |
| 10 | +import { postContent } from '@wordpress/icons'; | |
| 11 | + | |
| 12 | +const templatesName = [ | |
| 13 | + 'learnpress/learnpress//single-lp_course', | |
| 14 | + 'learnpress/learnpress//single-lp_course-offline', | |
| 15 | +]; | |
| 16 | + | |
| 17 | +checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => { | |
| 18 | + registerBlockType( metadataNew.name, { | |
| 19 | + ...metadataNew, | |
| 20 | + icon: postContent, | |
| 21 | + edit, | |
| 22 | + save, | |
| 23 | + } ); | |
| 24 | +} ); | |
| 25 | + | |
| 26 | +registerBlockType( metadata.name, { | |
| 27 | + ...metadata, | |
| 28 | + icon: postContent, | |
| 29 | + edit, | |
| 30 | + save, | |
| 31 | +} ); | |