fix percent
Этот коммит содержится в:
родитель
e4cc72e437
Коммит
54b6791395
10
js/batch.js
10
js/batch.js
@ -1,15 +1,19 @@
|
|||||||
jQuery( document ).ready( function($) {
|
jQuery( document ).ready( function($) {
|
||||||
var batch_progress = function ( data ) {
|
var batch_progress = function ( data ) {
|
||||||
$( '.batch-progress-message' ).html( data['progress_message'] );
|
$( '.batch-progress-message' ).html( data['progress_message'] );
|
||||||
$( '.batch-percent' ).html( data['percent'] + "%" );
|
var percent = 0;
|
||||||
$( '.batch-progress > span' ).animate({ width: data['percent'] + "%" }, 500);
|
if ( 'undefined' != typeof data['percent'] ) {
|
||||||
|
percent = data['percent'];
|
||||||
|
}
|
||||||
|
$( '.batch-percent' ).html( percent + "%" );
|
||||||
|
$( '.batch-progress > span' ).animate({ width: percent + "%" }, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
function batch_process() {
|
function batch_process() {
|
||||||
$.post(
|
$.post(
|
||||||
ajaxurl + '?action=batch_operations&id=' + batch_id,
|
ajaxurl + '?action=batch_operations&id=' + batch_id,
|
||||||
function( data ) {
|
function( data ) {
|
||||||
if (data['do']=='finish')
|
if ( 'finish' == data['do'] )
|
||||||
{
|
{
|
||||||
batch_progress( data );
|
batch_progress( data );
|
||||||
$( '.batch-message' ).html( data['message'] ).delay( 1500 ).queue( function () {
|
$( '.batch-message' ).html( data['message'] ).delay( 1500 ).queue( function () {
|
||||||
|
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