-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show an hourglass cursor when lengthy processes are underway #72
Comments
Comment by markbirbeck on 7 Jul 2010 4:12:28 PM UTCSo one way we might do this is to create a method to turn on the hourglass, and another to turn it off. We then call these two methods at the beginning and end of any potentially lengthy processes, such as XForms event handling. (That will then cover things like 'xforms-rebuild', and so on.) However, we don't want the hourglass to appear immediately, since if the operation is short it will get very annoying. So the logic will probably be something like this:
It's possible that the 'hourglass on' function will need to return a handle that can be used in the 'hourglass off' function. Updates Added label: performance |
Update by markbirbeck on 7 Jul 2010 7:54:49 PM UTCOwner set to creaven |
Comment by creaven on 8 Jul 2010 7:43:06 AM UTCto show/hide cursor we can add this to css: |
Comment by creaven on 14 Jul 2010 1:54:17 PM UTCshow test page which works slow and moment when want to show hourglass |
Comment by [email protected] on 15 Jul 2010 10:09:00 AM UTCSomeone is preparing a test form. But note that since this is a function I'd like to have generally available in the library, there doesn't need to be anything XForms-specific in the tests. In other words, this could be tested using a simple setTimer() to emulate a long running task. |
Comment by [email protected] on 15 Jul 2010 11:06:03 AM UTCTest form attached. Vary the number of iterations to affect the length of time taken to finish processing. Example timings for IE7 and Chrome are detailed in the form. Attachments test-setvalue-loop.html (2.7 KB) |
Comment by creaven on 15 Jul 2010 3:06:46 PM UTCit's impossible, because javascript executes timer function too late, test:
IE shows alert not after 100ms, but after it executes slow loop code (on my computer loop execution takes more than 100ms) implemented in: removed in: |
Comment by markbirbeck on 15 Jul 2010 7:29:22 PM UTCWhat happens if the slow loop code is placed into a setTimout() with a delay of zero or 1? If that works, then I think your original code is ok, since most of the XForms event handling is executed using setTimeout() to emulate threading. To put it another way, if anyone adds code that can't be interrupted in order to allow the hourglass then there is nothing we can do about it, so we might as well write the code the best we can, given those constraints. |
Comment by creaven on 19 Jul 2010 4:44:14 PM UTC
if remove setTimeout, it's too don't work. During loop browser freezed and don't change cursor seted before loop, test: //util.js var count = 0; this.Hourglass = function(delay) { Hourglass.prototype = {
}; function addClass(element, className) { function removeClass(element, className) { function hasClass(element, className) { })(); <title></title> <style type="text/css"> .hourglass, .hourglass *{ cursor:wait !important; } </style> <script src="util.js" type="text/javascript"></script> <script type="text/javascript"> var hourglass = new Hourglass(1500);//start delay 1500;
|
Imported from backplanejs Google Code issue 72.
At the moment the slowness of the XForms processor when running IE leaves users a bit confused as to when the form is usable.
To get around this we should display an hourglass cursor whenever any lengthy operations are taking place.
(Note that this is a feature that could be used outside of the XForms module, so I'm marking this as being in the 'core'.)
Ticket status set to Accepted
Priority: Medium
Type: Enhancement
The text was updated successfully, but these errors were encountered: