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

Commit bcc515f

Browse files
committed
Allow non customize_publish cap user to save draft snapshot and fix submit button issue on snapshot load
1 parent 7aee799 commit bcc515f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

js/customize-snapshots.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -227,20 +227,20 @@
227227
api.state( 'snapshot-exists' ).bind( function( exist ) {
228228
scheduleButton.toggle( exist );
229229
} );
230+
}
230231

231-
api.state( 'snapshot-saved' ).bind( function( saved ) {
232-
snapshotButton.prop( 'disabled', saved );
233-
} );
232+
api.state( 'snapshot-saved' ).bind( function( saved ) {
233+
snapshotButton.prop( 'disabled', saved );
234+
} );
234235

235-
api.state( 'saved' ).bind( function( saved ) {
236-
if ( saved ) {
237-
snapshotButton.prop( 'disabled', true );
238-
}
239-
} );
240-
api.bind( 'change', function() {
241-
snapshotButton.prop( 'disabled', false );
242-
} );
243-
}
236+
api.state( 'saved' ).bind( function( saved ) {
237+
if ( saved ) {
238+
snapshotButton.prop( 'disabled', true );
239+
}
240+
} );
241+
api.bind( 'change', function() {
242+
snapshotButton.prop( 'disabled', false );
243+
} );
244244

245245
api.state( 'snapshot-exists' ).bind( function( exists ) {
246246
var buttonText, permsMsg;
@@ -285,7 +285,7 @@
285285
submitButton = $( $.trim( submitButton( {
286286
buttonText: component.data.i18n.submit
287287
} ) ) );
288-
submitButton.prop( 'disabled', true );
288+
submitButton.prop( 'disabled', ! api.state( 'snapshot-exists' ).get() );
289289
submitButton.insertBefore( snapshotButton );
290290
api.state( 'snapshot-submitted' ).bind( function( submitted ) {
291291
submitButton.prop( 'disabled', submitted );

0 commit comments

Comments
 (0)