fix percent
Этот коммит содержится в:
родитель
e4cc72e437
Коммит
54b6791395
24
js/batch.js
24
js/batch.js
@ -1,26 +1,30 @@
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery( document ).ready( function($) {
|
||||
var batch_progress = function ( data ) {
|
||||
$( '.batch-progress-message' ).html( data['progress_message'] );
|
||||
$( '.batch-percent' ).html( data['percent'] + "%" );
|
||||
$( '.batch-progress > span' ).animate({ width: data['percent'] + "%" }, 500);
|
||||
var percent = 0;
|
||||
if ( 'undefined' != typeof data['percent'] ) {
|
||||
percent = data['percent'];
|
||||
}
|
||||
$( '.batch-percent' ).html( percent + "%" );
|
||||
$( '.batch-progress > span' ).animate({ width: percent + "%" }, 500);
|
||||
};
|
||||
|
||||
function batch_process() {
|
||||
$.post(
|
||||
ajaxurl+'?action=batch_operations&id='+batch_id,
|
||||
function(data){
|
||||
if (data['do']=='finish')
|
||||
ajaxurl + '?action=batch_operations&id=' + batch_id,
|
||||
function( data ) {
|
||||
if ( 'finish' == data['do'] )
|
||||
{
|
||||
batch_progress( data );
|
||||
$('.batch-message').html(data['message']).delay(1500).queue(function () {
|
||||
$(location).attr('href',successful_page);
|
||||
$(this).dequeue();
|
||||
$( '.batch-message' ).html( data['message'] ).delay( 1500 ).queue( function () {
|
||||
$( location ).attr( 'href', successful_page );
|
||||
$( this ).dequeue();
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.batch-message').html(data['message']);
|
||||
$( '.batch-message' ).html( data['message'] );
|
||||
batch_progress( data );
|
||||
batch_process()
|
||||
}
|
||||
|
2
js/batch.min.js
поставляемый
2
js/batch.min.js
поставляемый
@ -1 +1 @@
|
||||
jQuery(document).ready(function(a){function b(){a.post(ajaxurl+"?action=batch_operations&id="+batch_id,function(d){"finish"==d["do"]?(c(d),a(".batch-message").html(d.message).delay(1500).queue(function(){a(location).attr("href",successful_page),a(this).dequeue()})):(a(".batch-message").html(d.message),c(d),b())})}var c=function(b){a(".batch-progress-message").html(b.progress_message),a(".batch-percent").html(b.percent+"%"),a(".batch-progress > span").animate({width:b.percent+"%"},500)};b()});
|
||||
jQuery(document).ready(function(a){function b(){a.post(ajaxurl+"?action=batch_operations&id="+batch_id,function(d){"finish"==d["do"]?(c(d),a(".batch-message").html(d.message).delay(1500).queue(function(){a(location).attr("href",successful_page),a(this).dequeue()})):(a(".batch-message").html(d.message),c(d),b())})}var c=function(b){a(".batch-progress-message").html(b.progress_message);var c=0;"undefined"!=typeof b.percent&&(c=b.percent),a(".batch-percent").html(c+"%"),a(".batch-progress > span").animate({width:c+"%"},500)};b()});
|
Загрузка…
Ссылка в новой задаче
Block a user