WordPress.org

Make WordPress Core

Changeset 7411


Ignore:
Timestamp:
03/20/2008 04:39:23 AM (10 years ago)
Author:
markjaquith
Message:

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

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/widgets.js

    r7275 r7411  
    1212            var t = $(this);
    1313            if ( t.is(':visible') ) {
    14                 if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"]' ).attr( 'disabled', 'disabled' ); }
     14                if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
    1515                li.css( 'marginLeft', 0 );
    1616                t.siblings('h4').children('a').text( widgetsL10n.edit );
     
    2626
    2727            if ( t.is(':visible') ) {
    28                 if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"]' ).attr( 'disabled', 'disabled' ); }
     28                if ( disableFields ) { t.find( ':enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
    2929                if ( width > 250 )
    3030                    li.animate( { marginLeft: 0 } );
  • trunk/wp-includes/script-loader.php

    r7406 r7411  
    184184                'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
    185185            ) );
    186             $this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080313' );
     186            $this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080319' );
    187187            $this->localize( 'admin-widgets', 'widgetsL10n', array(
    188188                'add' => __('Add'),
  • trunk/wp-includes/widgets.php

    r7362 r7411  
    639639            <input class="widefat" id="text-title-<?php echo $number; ?>" name="widget-text[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" />
    640640            <textarea class="widefat" rows="16" cols="20" id="text-text-<?php echo $number; ?>" name="widget-text[<?php echo $number; ?>][text]"><?php echo $text; ?></textarea>
    641             <input type="hidden" id="text-submit-<?php echo $number; ?>" name="text-submit-<?php echo $number; ?>" value="1" />
     641            <input type="hidden" name="widget-text[<?php echo $number; ?>][submit]" value="1" />
    642642        </p>
    643643<?php
     
    799799            </p>
    800800
    801             <input type="hidden" id="categories-submit-<?php echo $number; ?>" name="categories-submit-<?php echo $number; ?>" value="1" />
     801            <input type="hidden" name="widget-categories[<?php echo $number; ?>][submit]" value="1" />
    802802<?php
    803803}
     
    12551255        </label>
    12561256    </p>
    1257     <input type="hidden" id="rss-submit-<?php echo $number; ?>" name="rss-submit-<?php echo $number; ?>" value="1" />
     1257    <input type="hidden" name="widget-rss[<?php echo $number; ?>][submit]" value="1" />
    12581258<?php
    12591259    endif;
     
    14841484        <p>
    14851485            <input class="widefat" id="widget-many-something-<?php echo $number; ?>" name="widget-many[<?php echo $number; ?>][something]" type="text" value="<?php echo $data; ?>" />
    1486             <input type="hidden" id="widget-many-submit-<?php echo $number; ?>" name="widget-many-<?php echo $number; ?>" value="1" />
     1486            <input type="hidden" id="widget-many-submit-<?php echo $number; ?>" name="widget-many[<?php echo $number; ?>][submit]" value="1" />
    14871487        </p>
    14881488<?php
Note: See TracChangeset for help on using the changeset viewer.