[vhffs-dev] [1669] Use publish/subscribe to show loading indicator. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1669
Author: beuss
Date: 2011-04-24 19:30:26 +0200 (Sun, 24 Apr 2011)
Log Message:
-----------
Use publish/subscribe to show loading indicator.
Modified Paths:
--------------
trunk/vhffs-panel/js/vhffs/Common.js
trunk/vhffs-public/templates/layouts/public.tt
Modified: trunk/vhffs-panel/js/vhffs/Common.js
===================================================================
--- trunk/vhffs-panel/js/vhffs/Common.js 2011-04-24 17:10:25 UTC (rev 1668)
+++ trunk/vhffs-panel/js/vhffs/Common.js 2011-04-24 17:30:26 UTC (rev 1669)
@@ -189,23 +189,11 @@
dojo.back.setInitialState(initState);
});
-
-/* Redefines core dojo XHR function to show
- * loading feedback.
- */
-dojo.oldXhr = dojo.xhr
-dojo.xhr = function(method, args, hasBody) {
- // Show the loading logo
+dojo.subscribe("/dojo/io/start", function() {
vhffs.Common.showLoading();
- // Back up the old load function and replace with our
- args['real_load'] = args['load'];
- args['load'] = function(response, ioArgs) {
- // Call the original load function
- if(args['real_load']) {
- args['real_load'](response, ioArgs);
- }
- // Everything's done, hide loading logo
- vhffs.Common.hideLoading();
- }
- dojo.oldXhr(method, args, hasBody);
-}
+});
+
+dojo.subscribe("/dojo/io/stop", function() {
+ vhffs.Common.hideLoading();
+})
+
Modified: trunk/vhffs-public/templates/layouts/public.tt
===================================================================
--- trunk/vhffs-public/templates/layouts/public.tt 2011-04-24 17:10:25 UTC (rev 1668)
+++ trunk/vhffs-public/templates/layouts/public.tt 2011-04-24 17:30:26 UTC (rev 1669)
@@ -10,7 +10,8 @@
<script type="text/javascript">
// Dojo configuration
djConfig = {
- preventBackButtonFix: false
+ preventBackButtonFix: false,
+ ioPublish: true
};
</script>