Fix the ajax loading/processing spinner for nav menu meta boxes. see #13134.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7677e2e874
commit
7bb32597b7
File diff suppressed because one or more lines are too long
|
@ -148,14 +148,12 @@
|
|||
float: right;
|
||||
}
|
||||
|
||||
form.processing .add-to-menu {
|
||||
background: url("../images/wpspin_light.gif") no-repeat top center;
|
||||
display:block;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
text-align:left;
|
||||
text-indent:-999em;
|
||||
width:20px;
|
||||
.postbox img.waiting {
|
||||
display: none
|
||||
vertical-align: middle;
|
||||
}
|
||||
form.processing .postbox img.waiting {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.button-controls { margin: 10px 0; }
|
||||
|
|
|
@ -434,6 +434,7 @@ function wp_nav_menu_item_link_meta_box() {
|
|||
|
||||
<p class="button-controls">
|
||||
<span class="add-to-menu">
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
<input type="submit" class="button-secondary" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" />
|
||||
</span>
|
||||
</p>
|
||||
|
@ -622,6 +623,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
|||
</span>
|
||||
|
||||
<span class="add-to-menu">
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
<input type="submit" class="button-secondary" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-post-type-menu-item" />
|
||||
</span>
|
||||
</p>
|
||||
|
@ -789,6 +791,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
|
|||
</span>
|
||||
|
||||
<span class="add-to-menu">
|
||||
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
|
||||
<input type="submit" class="button-secondary" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-taxonomy-menu-item" />
|
||||
</span>
|
||||
</p>
|
||||
|
|
|
@ -240,6 +240,9 @@ var WPNavMenuHandler = function () {
|
|||
$(formEL).bind('submit', function(e) {
|
||||
return that.eventSubmitMetaForm.call(that, this, e);
|
||||
});
|
||||
$(formEL).find('input:submit').click(function() {
|
||||
$(this).siblings('img.waiting').show();
|
||||
});
|
||||
},
|
||||
|
||||
attachTabsPanelListeners : function() {
|
||||
|
@ -484,9 +487,7 @@ var WPNavMenuHandler = function () {
|
|||
processMethod = function(){},
|
||||
re = new RegExp('menu-item\\[(\[^\\]\]*)');
|
||||
|
||||
thisForm.className = thisForm.className + ' processing',
|
||||
that = this;
|
||||
|
||||
params['action'] = '';
|
||||
|
||||
while ( i-- ) {
|
||||
|
@ -533,7 +534,7 @@ var WPNavMenuHandler = function () {
|
|||
|
||||
$.post( ajaxurl, params, function(menuMarkup) {
|
||||
processMethod.call(that, menuMarkup, params);
|
||||
thisForm.className = thisForm.className.replace(/processing/g, '');
|
||||
$(thisForm).find('img.waiting').hide();
|
||||
});
|
||||
|
||||
return false;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue