Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Fix JSCS.
Browse files Browse the repository at this point in the history
  • Loading branch information
miina committed Feb 14, 2017
1 parent 24840c8 commit 0edf0de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions js/customize-snapshots-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ var CustomizeSnapshotsFront = (function( $ ) {
var request;
e.preventDefault();

if ( ! confirm( component.data.confirmationMsg ) ) {
if ( ! window.confirm( component.data.confirmationMsg ) ) {
return false;
}
request = wp.ajax.post( component.data.action, {
nonce: component.data.snapshotsFrontendPublishNonce,
uuid: component.data.uuid
} );
request.done( function( data ) {
if ( data && data.success ){
if ( data && data.success ) {
window.location = e.target.href;
}
} );
request.fail( function( data ) {
alert( data.errorMsg );
window.alert( data.errorMsg );
} );

return true;
} );
};

return component;
})( jQuery );
})( jQuery );
4 changes: 2 additions & 2 deletions php/class-customize-snapshot-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function hooks() {
add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_controls_scripts' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
add_action( 'wp_ajax_customize-snapshots-frontend-publish', array( $this, 'snapshot_frontend_publish' ) );
add_action( 'wp_ajax_customize-snapshots-frontend-publish', array( $this, 'ajax_snapshot_frontend_publish' ) );

add_action( 'customize_controls_init', array( $this, 'add_snapshot_uuid_to_return_url' ) );
add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_templates' ) );
Expand Down Expand Up @@ -977,7 +977,7 @@ public function get_customize_uuid_param() {
/**
* Publishes changeset from frontend.
*/
public function snapshot_frontend_publish() {
public function ajax_snapshot_frontend_publish() {
if ( ! check_ajax_referer( 'customize-snapshots-frontend-publish', 'nonce' ) ) {
status_header( 400 );
wp_send_json_error( 'bad_nonce' );
Expand Down

0 comments on commit 0edf0de

Please sign in to comment.