[Lada-commits] [PATCH] LadaPrint: Give Feedback when printing is in Progress

Wald Commits scm-commit at wald.intevation.org
Wed Sep 30 16:08:51 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1443622120 -7200
# Node ID cbc0c3fdada6783dccbf69e1d8ee3cc8fa9473ab
# Parent  fe85a4d23370b0467d821cfdfda7155529b7ed1c
LadaPrint: Give Feedback when printing is in Progress

diff -r fe85a4d23370 -r cbc0c3fdada6 app/controller/FilterResult.js
--- 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);


More information about the Lada-commits mailing list