+ $('.buttontoolbarview-button', this.element).
+ bind('click.buttontoolbarview', this.buttonPressed.bind(this) );
+
+ $(this.element).trigger('resize');
+ },
+
+ buttonPressed: function(event)
+ {
+ var self = this;
+ var target = event.target;
+
+ var groupIndex = parseInt($(target).attr('ui:groupindex'), 10);
+ var buttonIndex = parseInt($(target).attr('ui:buttonindex'), 10);
+ var button = this.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 {
+ self.parent.freeze('Wykonuję akcję...');
+ setTimeout(function() {
+ scriptletCenter.scriptlets[scriptletId](self.parent, params);
+ self.parent.unfreeze();
+ }, 10);
+ } catch(e) {
+ console.log("Scriptlet", scriptletId, "failed.", e);
+ }
+
+ },