| 1 |
document.addEventListener( 'DOMContentLoaded', function () { |
| 2 |
if ( typeof elementor === 'undefined' ) { |
| 3 |
return; |
| 4 |
} |
| 5 |
|
| 6 |
// Form edit link |
| 7 |
elementor.channels.editor.on( 'sureforms:form:edit', function ( view ) { |
| 8 |
const block_id = view.elementSettingsModel.get( 'srfm_form_block' ); |
| 9 |
if ( ! block_id ) { |
| 10 |
return; |
| 11 |
} |
| 12 |
|
| 13 |
const win = window.open( |
| 14 |
srfmElementorData.admin_url + |
| 15 |
`post.php?post=${ block_id }&action=edit`, |
| 16 |
'_blank' |
| 17 |
); |
| 18 |
win.focus(); |
| 19 |
} ); |
| 20 |
|
| 21 |
// Form create link |
| 22 |
elementor.channels.editor.on( 'sureforms:form:create', function () { |
| 23 |
const win = window.open( srfmElementorData.add_new_form_url, '_blank' ); |
| 24 |
win.focus(); |
| 25 |
} ); |
| 26 |
} ); |
| 27 |
|