X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b264c171a5885976ef8f077be37e7cc83bf8a0fd..36387dac2e103ca656be9dc65fabb936f80191d1:/project/static/js/views/button_toolbar.js diff --git a/project/static/js/views/button_toolbar.js b/project/static/js/views/button_toolbar.js index 7e4b6eab..7f039985 100644 --- a/project/static/js/views/button_toolbar.js +++ b/project/static/js/views/button_toolbar.js @@ -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); } },