Changeset 12763
- Timestamp:
- 10/20/2020 06:25:43 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/js/blocks/embed-activity.js
r12747 r12763 221 221 _wp$components = _wp.components, 222 222 Placeholder = _wp$components.Placeholder, 223 Disabled = _wp$components.Disabled, 223 224 SandBox = _wp$components.SandBox, 224 225 Button = _wp$components.Button, 225 226 ExternalLink = _wp$components.ExternalLink, 226 227 Spinner = _wp$components.Spinner, 227 Toolbar = _wp$components.Toolbar,228 ToolbarGroup = _wp$components.ToolbarGroup, 228 229 ToolbarButton = _wp$components.ToolbarButton, 229 230 compose = _wp.compose.compose, … … 275 276 }; 276 277 277 var editToolbar = createElement(BlockControls, null, createElement(Toolbar , null, createElement(ToolbarButton, {278 var editToolbar = createElement(BlockControls, null, createElement(ToolbarGroup, null, createElement(ToolbarButton, { 278 279 icon: "edit", 279 280 title: __('Edit URL', 'buddypress'), … … 315 316 316 317 if (!preview || !preview['x_buddypress'] || 'activity' !== preview['x_buddypress']) { 317 // Reset the URL.318 setAttributes({319 url: ''320 });321 318 return createElement(Fragment, null, editToolbar, createElement(Placeholder, { 322 319 icon: "buddicons-activity", … … 331 328 }, createElement("div", { 332 329 className: "wp-block-embed__wrapper" 333 }, createElement( SandBox, {330 }, createElement(Disabled, null, createElement(SandBox, { 334 331 html: preview && preview.html ? preview.html : '', 335 332 scripts: [embedScriptURL] 336 })) , (!RichText.isEmpty(caption) || isSelected) && createElement(RichText, {333 }))), (!RichText.isEmpty(caption) || isSelected) && createElement(RichText, { 337 334 tagName: "figcaption", 338 335 placeholder: __('Write caption…', 'buddypress'), … … 355 352 isRequestingEmbedPreview = _select.isRequestingEmbedPreview; 356 353 357 var preview = undefined !==url && getEmbedPreview(url);358 var fetching = undefined !==url && isRequestingEmbedPreview(url);354 var preview = !!url && getEmbedPreview(url); 355 var fetching = !!url && isRequestingEmbedPreview(url); 359 356 return { 360 357 bpSettings: editorSettings.bp.activity || {}, -
trunk/src/js/bp-activity/js/blocks/embed-activity/edit.js
r12747 r12763 13 13 components: { 14 14 Placeholder, 15 Disabled, 15 16 SandBox, 16 17 Button, 17 18 ExternalLink, 18 19 Spinner, 19 Toolbar ,20 ToolbarGroup, 20 21 ToolbarButton, 21 22 }, … … 65 66 const editToolbar = ( 66 67 <BlockControls> 67 <Toolbar >68 <ToolbarGroup> 68 69 <ToolbarButton 69 70 icon="edit" … … 71 72 onClick={ switchBackToURLInput } 72 73 /> 73 </Toolbar >74 </ToolbarGroup> 74 75 </BlockControls> 75 76 ); … … 119 120 120 121 if ( ! preview || ! preview['x_buddypress'] || 'activity' !== preview['x_buddypress'] ) { 121 // Reset the URL.122 setAttributes( { url: '' } );123 124 122 return ( 125 123 <Fragment> … … 142 140 <figure className="wp-block-embed is-type-bp-activity"> 143 141 <div className="wp-block-embed__wrapper"> 144 <SandBox 145 html={ preview && preview.html ? preview.html : '' } 146 scripts={ [ embedScriptURL ] } 147 /> 142 <Disabled> 143 <SandBox 144 html={ preview && preview.html ? preview.html : '' } 145 scripts={ [ embedScriptURL ] } 146 /> 147 </Disabled> 148 148 </div> 149 149 { ( ! RichText.isEmpty( caption ) || isSelected ) && ( … … 170 170 } = select( 'core' ); 171 171 172 const preview = undefined !==url && getEmbedPreview( url );173 const fetching = undefined !==url && isRequestingEmbedPreview( url );172 const preview = !! url && getEmbedPreview( url ); 173 const fetching = !! url && isRequestingEmbedPreview( url ); 174 174 175 175 return {
Note: See TracChangeset
for help on using the changeset viewer.