X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3b9b115efb44c7570453c0729f05f83a3b45cd4d..97059a831f2e7ac44ccfacde3950cc2561c539ee:/project/static/js/views/button_toolbar.js?ds=sidebyside 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); } },