$.fn.uaButton_Text = function(options) { options = $.extend({ bEnabled: true },options); this. on('click',function(ev) { ev.stopImmediatePropagation(); if($(this).hasClass('uaDisabled')) return; $(this).trigger($.Event(EV_EXTERN,{uaData:{info:{ev:EV_CLICKED}}})); }). on(EV_CLEAR,function(ev) { ev.stopImmediatePropagation(); }). on(EV_SET_DEFAULT,function(ev) { ev.stopImmediatePropagation(); $(this).trigger($.Event(EV_ENABLE,{uaData:{data:{bEnable:options.bEnabled}}})); }). on(EV_ENABLE,function(ev) { ev.stopImmediatePropagation(); switch(ev.uaData.data.bEnable) { case true: $(this).removeClass('uaDisabled').addClass('text-primary uaSelectable'); break; default: $(this).removeClass('text-primary uaSelectable').addClass('uaDisabled'); break; };//switch(ev.uaData.data.bEnable) }); $(this).trigger($.Event(EV_ENABLE,{uaData:{data:{bEnable: options.bEnabled}}})); return this; };