This topic was marked solved by its starter, on August 1st, 2013, 04:53 AM
SMF bug 4962 (pressing cancel on the AJAX notification doesn't cancel it)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
All the 'cancel' link on an AJAX notification does is hide the 'Loading...' notification.

While we could theoretically just change the text to say 'close', I'd rather we either removed it entirely or we actually made it cancel. That shouldn't be too problematic, since we should be able to call .abort() on the object being used to handle the XHR itself (AIUI, jQuery > 1.5 exposes all methods from the XHR)

All we'd actually need to do is have it so that when we show the notification, we pass something to it by which we can call the abort... assuming we do that. If we don't, it gets a bit trickier to handle. Mind you... if we have two concurrent AJAX requests for whatever reason and both trigger 'Loading', it's impossible to know which would actually be cancelled.

Hmmm. Maybe it should just be renamed (or simply remove the hide button since having it really doesn't achieve anything useful)
Posted: March 1st, 2012, 02:50 PM

Bumpity. Inclined to simply remove the hide button, by the way, unless anyone has any burning issues with wanting to actually attempt to cancel the AJAX request?
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Sometimes, a server will go down while you're writing a quick edit. Happened to me. Clicking the close button only hid the banner but that's all. Iirc noisen uses an animated gif to show an action is being processed. Clicking the icon hides the banner. DFoes Wedge use that icon or Smf's?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Wedge uses its own spinner image (not SMF's one), and something I never noticed before... somewhere along the change, the spinner itself is actually the cancel button, there's no separate cancel button any more.

This to me says 'remove', but more than that, the number of people who post on sm.org about issues with this do not realise there is a close button on it because it just 'hangs' there for them.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Quote
These people are the reason SMF added the button in the first place.
But no-one uses it! Even when the button is immediately visible, no-one uses it. Making it visible after a period of time won't change that (and in any case you'd need to alter the behaviour so the spinner was more obviously a 'close' button than just being a spinner)

In any case, if the AJAX is taking that long to perform a lookup, odds are they should be coming to us for help anyway because something is obviously wrong...

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Which still takes us back to the original problem: you're just closing the notification, you're not closing the AJAX request, which seems like a waste to me.

More than that, most of the time it breaks, it's not breaking because of the connection/page being slow to serve but that the response returned is invalid, so really having it cancel the request isn't that useful in most cases, and IMO neither is closing the notification. What we should be doing is error handling it instead.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
I haven't tried it in Wedge with jQuery but certainly in SMF, if the response returned to getXMLDocument or sendXMLDocument was invalid, it would hit an error and end processing before it got to close the box.

There's no actual error handling attached, no warning to the user, the only things that are visible are the lingering box and the fact that what they asked for may not have been done.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278