Disabler module
Disabler = can.Control({}, {
! "{Models.Search} search": function(el, ev, searchInst){
! ! var types = searchInst.attr('types');
! ! this.element.find('li').removeClass('disabled').map(function(i, el){
! ! ! var $el = $(el);
! ! ! if(types.indexOf($el.data('service')) === -1){
! ! ! ! $el.addClass('disabled');
! ! ! }
! ! });
! ! this.element.find('li:not(.disabled):first').trigger('activate')
! },
! "li activate" : function(el, ev){
! ! if(el.hasClass('disabled')){
! ! ! ev.stopImmediatePropagation();
! ! }
! }
})