Interaktywne błędy, gdy nie udało się wczytać HTML'a.
[redakcja.git] / project / static / js / views / button_toolbar.js
index 7e4b6ea..7f03998 100644 (file)
@@ -47,6 +47,7 @@ var ButtonToolbarView = View.extend({
 
     buttonPressed: function(event)
     {
+        var self = this;
         var target = event.target;
         
         var groupIndex = parseInt($(target).attr('ui:groupindex'), 10);
@@ -57,9 +58,13 @@ var ButtonToolbarView = View.extend({
 
         console.log('Executing', scriptletId, 'with params', params);
         try {
-            scriptletCenter.scriptlets[scriptletId](this.parent, params);
+            self.parent.freeze('Wykonuję akcję...');
+            setTimeout(function() {
+                scriptletCenter.scriptlets[scriptletId](self.parent, params);
+                self.parent.unfreeze();
+            }, 10);
         } catch(e) {
-            console.log("Scriptlet", scriptletId, "failed.");
+            console.log("Scriptlet", scriptletId, "failed.", e);
         }
 
     },