Business listings for Yacht Equipment Companies


Business listings for Yacht Equipment Companies | AIS Marine Traffic

FILTERS

BUSINESS ACTIVITY

COUNTRY

‘); }, complete: function(xhr, status) { $(‘.tt-hint’).removeClass(‘has-input-loader’).siblings(‘.input-loader’).remove(); } } } }); companyNames.initialize(); companyNames.clearPrefetchCache(); //registered handlebar helper in order to have conditional output Handlebars.registerHelper( ‘searchResults’, function ( company_id, trading_name, company_name, dynamic_link, dynamic_cat, dynamic_descr ){ var final_text = ”, output = ”; if (dynamic_cat === ‘company’ || dynamic_cat === ‘all’) { if (trading_name === null || trading_name === ” || company_name === null || company_name === ”) { final_text = (trading_name === null || trading_name === ”) ? company_name : trading_name; } else { final_text = trading_name; } output = ‘

‘+final_text+”; } else if (dynamic_cat === ‘port’ || dynamic_cat === ‘Serviced Port’) { //final_text = company_name + ‘ (‘ + country_code + ‘)’; output = ‘

‘+company_name+”; } else if (dynamic_cat === ‘tag’ || dynamic_cat === ‘industry’) { output = ‘

(‘+dynamic_descr+’)  ‘+company_name+”; } else if (dynamic_cat === ‘location’ || dynamic_cat === ‘sublocation’) { output = ‘

‘+company_name+”; } else { output = ‘

‘+company_name+”; } return new Handlebars.SafeString(output); }); $(‘#bdsearch .typeahead’).typeahead( { hint: true, highlight: true, minLength: 3, }, { name: ‘company_name’, displayKey: ‘company_name’, source: companyNames.ttAdapter(), templates: { empty: [ ”, ‘No match found’, ” ].join(‘n’), suggestion: Handlebars.compile(‘

{{searchResults company_id trading_name company_name dynamic_link dynamic_cat dynamic_descr}}’) } } ) //added for enter select function instead of select and search which is the $(‘#bdsearch .typeahead’).bind(‘typeahead:selected’, function(obj, datum, name) { if (datum.dynamic_cat == ‘tag’) { var id = datum.company_id; $.ajax({ type: ‘POST’, data: {tg:id}, dataType: ‘html’, url : ‘/en/maritime-companies/updateTag’, success: function(data, textStatus) { }, error: function(data, textStatus) { } }); } if ( datum.dynamic_link) { window.location.href = datum.dynamic_link; } }); $(“input#result_page”).focusout( function() { $(this).val(1); }); $(“form.page_select”).submit(function(e){ e.preventDefault(); if (parseInt($(“input#result_page”).val()) > 1) { new Messi(“”, { title : “Page can not exceed 1”, titleClass : “error” }); } else { var surl = $.mtdata.getUpdatedUrlB(“page”, $(“input#result_page”).val()); $.mtdata.doAjax(surl, false, null, null); } }); }); //]]]]> ]]>



Source

Leave a Reply