changeset 939:cbc0c3fdada6

LadaPrint: Give Feedback when printing is in Progress
author Dustin Demuth <dustin@intevation.de>
date Wed, 30 Sep 2015 16:08:40 +0200
parents fe85a4d23370
children 1e2895bfa410
files app/controller/FilterResult.js
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/FilterResult.js	Wed Sep 30 15:47:56 2015 +0200
+++ b/app/controller/FilterResult.js	Wed Sep 30 16:08:40 2015 +0200
@@ -217,6 +217,11 @@
      * Send the selection to a Printservice
      */
     printSelection: function(button) {
+
+        //disable Button and setLoading...
+        button.disable();
+        button.setLoading(true);
+
         var grid = button.up('grid');
         var selection = grid.getView().getSelectionModel().getSelection();
         var i18n = Lada.getApplication().bundle;
@@ -327,12 +332,16 @@
                 var filetype = response.getResponseHeader('Content-Type');
                 var blob = new Blob([content],{type: filetype});
                 saveAs(blob, 'lada-print.pdf');
+                button.enable();
+                button.setLoading(false);
             },
             failure: function(response) {
                 console.log('failure');
                 // Error handling
                 // TODO
                 //console.log(response.responseText)
+                button.enable();
+                button.setLoading(false);
                 if (response.responseText) {
                     try {
                         var json = Ext.JSON.decode(response.responseText);

http://lada.wald.intevation.org