+ var trigger = view.find('[data-cmd='+cmd+']'),
+ disabledText = trigger.attr('data-disabled-text'),
+ originalContent = trigger.data('originalContent');
+ trigger.toggleClass('disabled', !enabled);
+ if(enabled && originalContent) {
+ trigger.html(originalContent);
+ trigger.removeData('originalContent');
+ }
+ if(!enabled && disabledText) {
+ trigger.data('originalContent', trigger.html());
+ trigger.text(disabledText);
+ }