sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 52940 - http://anonsvn.icesoft.org/repo / icefaces4 / trunk / icefaces / core / src / main / javascript / application.js
Unified Diff View - application.js
/icefaces4/trunk/icefaces/core/src/main/javascript/application.js @ revision 52939
/icefaces4/trunk/icefaces/core/src/main/javascript/application.js @ revision 52940
@@ -339,12 +339,24 @@                         var url = encodedURLElement ? encodedURLElement.value : form.action;                         form.action = url.replace(/(\?|&)cid=[0-9]+/, "$1");                         debug(logger, 'dispose window and associated views ' + viewIDs); -                        postSynchronously(client, form.action, function(query) { +                        var querySetup = function(query) {                             addNameValue(query, prefix + 'ice.submit.type', 'ice.dispose.window');                             addNameValue(query, prefix + 'ice.window', namespace.window);                             addNameValue(query, prefix + 'javax.faces.ViewState', lookupViewState(form));                             each(viewIDs, curry(addNameValue, query, 'ice.view')); -                        }, FormPost, noop); +                        }; +                        if (navigator.sendBeacon) { +                            var data = new FormData(); +                            var query = object(function(method) { +                                method(addNameValue, function (self, name, value) { +                                    data.append(name, value); +                                }); +                            }); +                            querySetup(query); +                            navigator.sendBeacon(form.action, data); +                        } else { +                            postSynchronously(client, form.action, querySetup, FormPost, noop); +                        }                     } catch (e) {                         warn(logger, 'failed to notify window disposal', e);                     }


feed icon

sventon 2.5.1