diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js index 235467dd1c..ad39b990cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js @@ -15,22 +15,10 @@ $(document).ready(function(){ } else { $("#filteraction_off").toggle(); } + + searchfield_date_tooltip(); $("#searchfieldstype").change(function() { - var MSG_DATE_FORMAT = ""; - if ( $(this).val() == 'dateofbirth' ) { - if( dateformat == 'us' ){ - MSG_DATE_FORMAT = MSG_DATE_FORMAT_US; - } else if( dateformat == 'iso' ){ - MSG_DATE_FORMAT = MSG_DATE_FORMAT_ISO; - } else if( dateformat == 'metric' ){ - MSG_DATE_FORMAT = MSG_DATE_FORMAT_METRIC; - } else if( dateformat == 'dmydot' ){ - MSG_DATE_FORMAT = MSG_DATE_FORMAT_DMYDOT; - } - $('#searchmember').attr("title", MSG_DATE_FORMAT).tooltip('show'); - } else { - $('#searchmember').tooltip('destroy'); - } + searchfield_date_tooltip(); }); if( CAN_user_borrowers_edit_borrowers ){ @@ -104,6 +92,24 @@ $(document).ready(function(){ }); }); +function searchfield_date_tooltip() { + var MSG_DATE_FORMAT = ""; + if ( $("#searchfieldstype").val() == 'dateofbirth' ) { + if( dateformat == 'us' ){ + MSG_DATE_FORMAT = MSG_DATE_FORMAT_US; + } else if( dateformat == 'iso' ){ + MSG_DATE_FORMAT = MSG_DATE_FORMAT_ISO; + } else if( dateformat == 'metric' ){ + MSG_DATE_FORMAT = MSG_DATE_FORMAT_METRIC; + } else if( dateformat == 'dmydot' ){ + MSG_DATE_FORMAT = MSG_DATE_FORMAT_DMYDOT; + } + $('#searchmember').attr("title", MSG_DATE_FORMAT).tooltip('show'); + } else { + $('#searchmember').tooltip('destroy'); + } +} + function confirm_updatechild() { var is_confirmed = window.confirm( MSG_CONFIRM_UPDATE_CHILD ); if (is_confirmed) {