This repository was archived by the owner on Apr 5, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/components/Pages/Page Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -292,18 +292,13 @@ class PageEdit extends React.Component {
292
292
}
293
293
}
294
294
295
- /**
296
- * Hander for when the value of the page template from the DropDown is changed.
297
- * @param {integer } templateId - The new template id
298
- * @return undefined
299
- */
300
- handleTemplateChange ( templateId ) {
301
- if ( this . state . templateId === templateId ) {
295
+ handleTemplateChange ( templateOption ) {
296
+ if ( this . state . templateId === templateOption . id ) {
302
297
return ;
303
298
}
304
299
305
300
this . updateData ( ) ;
306
- this . updateTemplate ( templateId ) ;
301
+ this . updateTemplate ( templateOption . id ) ;
307
302
}
308
303
309
304
updateTemplate ( templateId ) {
@@ -382,7 +377,7 @@ class PageEdit extends React.Component {
382
377
options = { this . state . templateOptions }
383
378
indexes = { this . state . templateIds }
384
379
selectedOption = { this . state . templateOptions [ this . state . templateId ] }
385
- handleChangeCallback = { ( templateId ) => this . handleTemplateChange ( templateId ) }
380
+ handleChangeCallback = { ( selectedOption ) => this . handleTemplateChange ( selectedOption ) }
386
381
/>
387
382
{ /* Do not display the slug text field if this is the homepage (page with full_path of "/") */ }
388
383
{ this . state . editContext === 'edit' && this . state . full_path === '/' ?
You can’t perform that action at this time.
0 commit comments