Этот коммит содержится в:
2015-06-10 12:51:19 +03:00
родитель 16636f3a27
Коммит a30aefadd6
7 изменённых файлов: 58 добавлений и 23 удалений

Просмотреть файл

@@ -1,17 +1,17 @@
jQuery(document).ready(function($) {
var batch_progress = function (percent){
$(".batch-percent").html(percent + "%");
return $(".batch-progress > span").animate({ width: percent + "%" }, 600);
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);
};
function batch_process(){
function batch_process() {
$.post(
ajaxurl+'?action=batch_operations&id='+batch_id,
function(data){
if (data['do']=='finish')
{
batch_progress(data['percent']);
batch_progress( data );
$('.batch-message').html(data['message']).delay(1500).queue(function () {
$(location).attr('href',successful_page);
$(this).dequeue();
@@ -21,7 +21,7 @@ jQuery(document).ready(function($) {
else
{
$('.batch-message').html(data['message']);
batch_progress(data['percent']);
batch_progress( data );
batch_process()
}
}

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.percent),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.percent),b())})}var c=function(b){return a(".batch-percent").html(b+"%"),a(".batch-progress > span").animate({width:b+"%"},600)};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),a(".batch-percent").html(b.percent+"%"),a(".batch-progress > span").animate({width:b.percent+"%"},500)};b()});