Match count update for import too
This commit is contained in:
@@ -43,6 +43,8 @@
|
||||
}
|
||||
if (result.Action != undefined && result.Action != null) {
|
||||
$('.match-status', $row).append(" " + result.Action);
|
||||
var $action = $("a[matchcount]", $row);
|
||||
matchCountFunc.apply($action);
|
||||
}
|
||||
|
||||
submitNext();
|
||||
|
||||
+16
-13
@@ -83,21 +83,24 @@ $(function () {
|
||||
}
|
||||
});
|
||||
|
||||
var matchCountFunc = function() {
|
||||
var $link = $(this);
|
||||
var url = $link.attr("matchcount");
|
||||
return $.ajax({
|
||||
url: url,
|
||||
success: function(matchcount) {
|
||||
if (matchcount > 0) {
|
||||
$link.append(" <span class='badge badge-info'>" + matchcount + "</span>");
|
||||
} else {
|
||||
$link.append(" <span class='badge'>0</span>");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// add get match count for all the current items
|
||||
$(function () {
|
||||
var $requests = $("a[matchcount]").map(function() {
|
||||
var $link = $(this);
|
||||
return $.ajax({
|
||||
url: $link.attr("matchcount"),
|
||||
success: function (matchcount) {
|
||||
if (matchcount > 0) {
|
||||
$link.append(" <span class='badge badge-info'>" + matchcount + "</span>");
|
||||
} else {
|
||||
$link.append(" <span class='badge'>0</span>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
var $requests = $("a[matchcount]").map(matchCountFunc);
|
||||
$.when.apply($, $requests);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user