|
227 | 227 | api.state( 'snapshot-exists' ).bind( function( exist ) {
|
228 | 228 | scheduleButton.toggle( exist );
|
229 | 229 | } );
|
| 230 | + } |
230 | 231 |
|
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 | + } ); |
234 | 235 |
|
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 | + } ); |
244 | 244 |
|
245 | 245 | api.state( 'snapshot-exists' ).bind( function( exists ) {
|
246 | 246 | var buttonText, permsMsg;
|
|
285 | 285 | submitButton = $( $.trim( submitButton( {
|
286 | 286 | buttonText: component.data.i18n.submit
|
287 | 287 | } ) ) );
|
288 |
| - submitButton.prop( 'disabled', true ); |
| 288 | + submitButton.prop( 'disabled', ! api.state( 'snapshot-exists' ).get() ); |
289 | 289 | submitButton.insertBefore( snapshotButton );
|
290 | 290 | api.state( 'snapshot-submitted' ).bind( function( submitted ) {
|
291 | 291 | submitButton.prop( 'disabled', submitted );
|
|
0 commit comments