var isNotEmpty = function() {
for(var i in $mapSearchElements)
- if( ($mapSearchElements[i].attr('id') != prefix + 'country') && ($mapSearchElements[i].val() == '') )
+ if( ($mapSearchElements[i].attr('id') != prefix + 'country') && ($mapSearchElements[i].val() === '') )
return false;
return true;
};
}
source_address = source_address || '';
- var query = source_address != '' ? 'saddr=' + encodeURIComponent(source_address) + '&daddr=' : 'q=';
+ var query = source_address !== '' ? 'saddr=' + encodeURIComponent(source_address) + '&daddr=' : 'q=';
var url = 'https://maps.google.com/maps?' + query + encodeURIComponent(searchString);
window.open(url, '_blank');
showMap();
});
for(var i in $mapSearchElements)
- $mapSearchElements[i].keyup(function() {
- testInputs();
- });
+ $mapSearchElements[i].keyup(testInputs);
this.testInputs();
};
return true;
var number = $input.val().replace(/\s+/g, '');
- if (number == '')
+ if (number === '')
$action.hide();
else
$action.prop('href', 'controller.pl?action=CTI/call&number=' + encodeURIComponent(number)).show();
return true;
};
+
+ this.inline_report = function(target, source, data){
+ $.ajax({
+ url: source,
+ success: function (rsp) {
+ $(target).html(rsp);
+ $(target).find('.paginate').find('a').click(function(event){ ns.redirect_event(event, target) });
+ $(target).find('a.report-generator-header-link').click(function(event){ ns.redirect_event(event, target) });
+ },
+ data: data,
+ });
+ };
+ this.redirect_event = function(event, target){
+ event.preventDefault();
+ ns.inline_report(target, event.target + '', {});
+ };
});
function local_reinit_widgets() {