Always load the Dashboard RSS widgets with AJAX, see #10133 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@11613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
|
||||
|
||||
jQuery(document).ready( function($) {
|
||||
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
|
||||
// These widgets are sometimes populated via ajax
|
||||
ajaxWidgets = [
|
||||
'dashboard_incoming_links',
|
||||
@@ -9,15 +9,35 @@ jQuery(document).ready( function($) {
|
||||
'dashboard_plugins'
|
||||
];
|
||||
|
||||
ajaxPopulateWidgets = function() {
|
||||
$.each( ajaxWidgets, function() {
|
||||
var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading');
|
||||
if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); }
|
||||
} );
|
||||
ajaxPopulateWidgets = function(el) {
|
||||
show = function(id, i) {
|
||||
var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
|
||||
if ( e.length ) {
|
||||
p = e.parent();
|
||||
setTimeout( function(){
|
||||
p.load('index-extra.php?jax=' + id, '', function() {
|
||||
p.hide().slideDown('normal', function(){
|
||||
$(this).css('display', '');
|
||||
if ( 'dashboard_plugins' == id && $.isFunction(tb_init) )
|
||||
tb_init('#dashboard_plugins a.thickbox');
|
||||
});
|
||||
});
|
||||
}, i * 500 );
|
||||
}
|
||||
}
|
||||
if ( el ) {
|
||||
el = el.toString();
|
||||
if ( $.inArray(el, ajaxWidgets) != -1 )
|
||||
show(el, 0);
|
||||
} else {
|
||||
$.each( ajaxWidgets, function(i) {
|
||||
show(this, i);
|
||||
});
|
||||
}
|
||||
};
|
||||
ajaxPopulateWidgets();
|
||||
|
||||
postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } );
|
||||
postboxes.add_postbox_toggles('dashboard', { pbshow: ajaxPopulateWidgets } );
|
||||
|
||||
/* QuickPress */
|
||||
quickPressLoad = function() {
|
||||
|
||||
Reference in New Issue
Block a user