- var self = this;
- $('.buttontoolbarview-button', this.element).bind('click.buttontoolbarview', function() {
- var groupIndex = parseInt($(this).attr('ui:groupindex'), 10);
- var buttonIndex = parseInt($(this).attr('ui:buttonindex'), 10);
- var button = self.get('buttons')[groupIndex].buttons[buttonIndex];
- var scriptletId = button.scriptlet_id;
- var params = eval('(' + button.params + ')'); // To nie powinno być potrzebne
- console.log('Executing', scriptletId, 'with params', params);
- scriptletCenter[scriptletId](self.parent, params);
- });
- },
+ $('.buttontoolbarview-button', this.element).bind('click.buttontoolbarview', function(event) {
+ var groupIndex = parseInt($(this).attr('ui:groupindex'), 10);
+ var buttonIndex = parseInt($(this).attr('ui:buttonindex'), 10);
+ var button = self.get('buttons')[groupIndex].buttons[buttonIndex];
+ var scriptletId = button.scriptlet_id;
+ var params = eval('(' + button.params + ')'); // To nie powinno być potrzebne
+
+ console.log('Executing', scriptletId, 'with params', params);
+ try {
+ scriptletCenter.scriptlets[scriptletId](self.parent, params);
+ } catch(e) {
+ console.log("Scriptlet", scriptletId, "failed.");
+ }
+ });
+
+ $(this.element).trigger('resize');
+ },