| @@ -1,30 +1,30 @@ | ||
| 1 | -( function( $ ) { | |
| 2 | - const duplicatePost = function duplicatePost( e ) { | |
| 3 | - e.preventDefault(); | |
| 4 | - | |
| 5 | - const _self = $( this ), | |
| 6 | - _id = _self.data( 'post-id' ); | |
| 7 | - | |
| 8 | - $.ajax( { | |
| 9 | - url: '', | |
| 10 | - data: { | |
| 11 | - 'lp-ajax': 'duplicator', | |
| 12 | - id: _id, | |
| 13 | - nonce: lpGlobalSettings.nonce, | |
| 14 | - }, | |
| 15 | - success( response ) { | |
| 16 | - response = LP.parseJSON( response ); | |
| 17 | - | |
| 18 | - if ( response.success ) { | |
| 19 | - window.location.href = response.data; | |
| 20 | - } else { | |
| 21 | - alert( response.data ); | |
| 22 | - } | |
| 23 | - }, | |
| 24 | - } ); | |
| 25 | - }; | |
| 26 | - | |
| 27 | - $( function() { | |
| 28 | - $( document ).on( 'click', '.lp-duplicate-row-action .lp-duplicate-post', duplicatePost ); | |
| 29 | - } ); | |
| 30 | -}( jQuery ) ); | |
| 1 | +( function( $ ) { | |
| 2 | + const duplicatePost = function duplicatePost( e ) { | |
| 3 | + e.preventDefault(); | |
| 4 | + | |
| 5 | + const _self = $( this ), | |
| 6 | + _id = _self.data( 'post-id' ); | |
| 7 | + | |
| 8 | + $.ajax( { | |
| 9 | + url: '', | |
| 10 | + data: { | |
| 11 | + 'lp-ajax': 'duplicator', | |
| 12 | + id: _id, | |
| 13 | + nonce: lpGlobalSettings.nonce, | |
| 14 | + }, | |
| 15 | + success( response ) { | |
| 16 | + response = LP.parseJSON( response ); | |
| 17 | + | |
| 18 | + if ( response.success ) { | |
| 19 | + window.location.href = response.data; | |
| 20 | + } else { | |
| 21 | + alert( response.data ); | |
| 22 | + } | |
| 23 | + }, | |
| 24 | + } ); | |
| 25 | + }; | |
| 26 | + | |
| 27 | + $( function() { | |
| 28 | + $( document ).on( 'click', '.lp-duplicate-row-action .lp-duplicate-post', duplicatePost ); | |
| 29 | + } ); | |
| 30 | +}( jQuery ) ); | |