Wait cursor is not changing until mouse moves
Hi,
I have simple code to display the busy cursor while I am waiting for the ajax call to be finished (callback done) and when the call is finished I restore the cursor to the default value (method always).
I have noticed that if I don’t move the mouse the icon for the mouse does not change. The same happens the other way around – when the call is finished the cursor default icon is not restored until I move the mouse.
Is there something wrong I am doing or this is genuine bug in Chrome (I am using Version 68.0.3440.106 (Official Build) (64-bit)).
Kind Regards,
Janusz
- HTML:
- $(document).ready(function() {
- $('#refresh').on('click', function(event) {
- var str = $.param({ "ID": "","Message": ""});
- $.ajax({
- url: "/log_submit",
- type: 'POST',
- dataType: 'json',
- data: str,
- processData: false
- }).done(function(data, textStatus, xhr) {
- if (xhr.status == 201) {
- UserCtr++;
- }
- var logTable = $("#headers");
- logTable.html("<th>ID</th><th>Message</th>");
- var logs = $("#logTable");
- for(var i = 0; i < data.logs.length; i++) {
- logs.append("<tr><td>"+data.logs[i][0]+"</td><td>"+data.logs[i][1]+"</td></tr>");
- console.log("Item="+data.logs[i][0]);
- console.log("Item="+data.logs[i][1]);
- }
- })
- .fail(function(jqXhr, textStatus, errorThrown) {
- console.log( errorThrown );
- }).always(function(){
- $("#getLogsButton, #logsAccordionItemContent p").removeClass('wait');
- });
-
- $("#getLogsButton, #logsAccordionItemContent p").addClass('wait');
- event.preventDefault();
- });
- });
- css:
- .wait { cursor: wait;}
- }
- #wait { cursor: wait;}
- }