hfe-elementor-pro-compatibility.js
38 lines
| 1 | (function($){ |
| 2 | |
| 3 | EHF_EPRO_Compatibility = { |
| 4 | |
| 5 | /** |
| 6 | * Binds events for the Elementor Header Footer. |
| 7 | * |
| 8 | * @since 1.4.0 |
| 9 | * @access private |
| 10 | * @method _bind |
| 11 | */ |
| 12 | init: function() { |
| 13 | elementor.on( "document:loaded", function() { |
| 14 | setTimeout( function() { |
| 15 | jQuery.each( elementorFrontend.documentsManager.documents, function ( index, document ) { |
| 16 | var $documentElement = document.$element; |
| 17 | var ids_array = JSON.parse( hfe_admin.ids_array ); |
| 18 | ids_array.forEach( function( item, index ){ |
| 19 | var elementor_id = $documentElement.data( 'elementor-id' ); |
| 20 | if( elementor_id == ids_array[index].id ){ |
| 21 | $documentElement.find( '.elementor-document-handle__title' ).text( elementor.translate('edit_element', [ids_array[index].value] ) ); |
| 22 | } |
| 23 | } ); |
| 24 | }); |
| 25 | }, 1000 ); |
| 26 | }); |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | /** |
| 31 | * Initialize EHF_EPRO_Compatibility |
| 32 | */ |
| 33 | $(function(){ |
| 34 | EHF_EPRO_Compatibility.init(); |
| 35 | }); |
| 36 | |
| 37 | })(jQuery); |
| 38 |