Changeset 22795
- Timestamp:
- 11/21/2012 09:11:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r22742 r22795 424 424 (function($){ 425 425 function getFieldsContent() { 426 return ($('#title').val() || '') + ($('#attachment_caption').val() || '') + 427 ($('#attachment_alt').val() || '') + ($('#attachment_content').val() || '') + ($('#post_name').val() || ''); 426 return [ $('#title').val() || '', 427 $('#attachment_caption').val() || '', 428 $('#attachment_alt').val() || '', 429 $('#attachment_content').val() || '', 430 $('#post_name').val() || '' ]; 428 431 } 429 432 … … 431 434 432 435 window.onbeforeunload = function() { 433 if ( initial != getFieldsContent() ) 436 var i, changed, current = getFieldsContent(); 437 for ( var i = 0; i < initial.length; i++ ) { 438 if ( changed = ( inital[i] !== current[i]) ) 439 break; 440 } 441 if ( changed ) 434 442 return '<?php _e('The changes you made will be lost if you navigate away from this page.'); ?>'; 435 443 };
Note: See TracChangeset
for help on using the changeset viewer.