Multi-widgets should never be removed if you click cancel. props mdawaffe. fixes #6291

git-svn-id: https://develop.svn.wordpress.org/trunk@7411 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-03-20 04:39:23 +00:00
parent 9ab5b3bcdf
commit b6b80aea33
3 changed files with 7 additions and 7 deletions

View File

@ -11,7 +11,7 @@ jQuery(function($) {
var widgetAnim = $.browser.msie ? function() {
var t = $(this);
if ( t.is(':visible') ) {
if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"]' ).attr( 'disabled', 'disabled' ); }
if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
li.css( 'marginLeft', 0 );
t.siblings('h4').children('a').text( widgetsL10n.edit );
} else {
@ -25,7 +25,7 @@ jQuery(function($) {
var t = $(this);
if ( t.is(':visible') ) {
if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"]' ).attr( 'disabled', 'disabled' ); }
if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
if ( width > 250 )
li.animate( { marginLeft: 0 } );
t.siblings('h4').children('a').text( widgetsL10n.edit );

View File

@ -183,7 +183,7 @@ class WP_Scripts {
'saveText' => attribute_escape(__('Save »')),
'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
) );
$this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080313' );
$this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080319' );
$this->localize( 'admin-widgets', 'widgetsL10n', array(
'add' => __('Add'),
'edit' => __('Edit'),

View File

@ -638,7 +638,7 @@ function wp_widget_text_control($widget_args) {
<p>
<input class="widefat" id="text-title-<?php echo $number; ?>" name="widget-text[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" />
<textarea class="widefat" rows="16" cols="20" id="text-text-<?php echo $number; ?>" name="widget-text[<?php echo $number; ?>][text]"><?php echo $text; ?></textarea>
<input type="hidden" id="text-submit-<?php echo $number; ?>" name="text-submit-<?php echo $number; ?>" value="1" />
<input type="hidden" name="widget-text[<?php echo $number; ?>][submit]" value="1" />
</p>
<?php
}
@ -798,7 +798,7 @@ function wp_widget_categories_control( $widget_args ) {
</label>
</p>
<input type="hidden" id="categories-submit-<?php echo $number; ?>" name="categories-submit-<?php echo $number; ?>" value="1" />
<input type="hidden" name="widget-categories[<?php echo $number; ?>][submit]" value="1" />
<?php
}
@ -1254,7 +1254,7 @@ function wp_widget_rss_form( $args, $inputs = null ) {
<?php _e('Display item date?'); ?>
</label>
</p>
<input type="hidden" id="rss-submit-<?php echo $number; ?>" name="rss-submit-<?php echo $number; ?>" value="1" />
<input type="hidden" name="widget-rss[<?php echo $number; ?>][submit]" value="1" />
<?php
endif;
foreach ( array_keys($default_inputs) as $input ) :
@ -1483,7 +1483,7 @@ function widget_many_control( $widget_args = 1 ) {
?>
<p>
<input class="widefat" id="widget-many-something-<?php echo $number; ?>" name="widget-many[<?php echo $number; ?>][something]" type="text" value="<?php echo $data; ?>" />
<input type="hidden" id="widget-many-submit-<?php echo $number; ?>" name="widget-many-<?php echo $number; ?>" value="1" />
<input type="hidden" id="widget-many-submit-<?php echo $number; ?>" name="widget-many[<?php echo $number; ?>][submit]" value="1" />
</p>
<?php
}