Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
js move
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Aug 28, 2019
1 parent 1728f63 commit 0288521
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 59 deletions.

This file was deleted.

49 changes: 48 additions & 1 deletion src/modules/mod_agosms_search/tmpl/Default/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,54 @@
?>

<script type="text/javascript">
<?php require(JModuleHelper::getLayoutPath('mod_agosms_search', $params->get('module_template', 'Default') . '/elements/basic_scripts')); ?>

var sliderLock = 0; // used for apply form change only after slider stop

jQuery(document).ready(function($) {
$("#GSearch<?php echo $module->id; ?> .gsearch-field-calendar").each(function() {
$(this).find("input:eq(0)").attr("placeholder", "<?php echo JText::_('MOD_AGOSMSSEARCHFILTER_TYPE_DATE_FROM'); ?>");
$(this).find("input:eq(1)").attr("placeholder", "<?php echo JText::_('MOD_AGOSMSSEARCHFILTER_TYPE_DATE_TO'); ?>");
});
$("#GSearch<?php echo $module->id; ?> .gsearch-field-calendar.single input").attr("placeholder", "<?php echo JText::_('MOD_AGOSMSSEARCHFILTER_TYPE_DATE'); ?>");
$(".gsearch-field-calendar input").addClass("inputbox");

$("#GSearch<?php echo $module->id; ?> .gsearch-field-text input[name=keyword]").on("keyup", function(event) {
if(event.which == 13) {
submit_form_<?php echo $module->id; ?>();
}
});

$("#GSearch<?php echo $module->id; ?> form").submit(function() {
<?php if($params->get("search_history")) { ?>
search_history<?php echo $module->id; ?>();
<?php } ?>
<?php if($params->get("search_stats")) { ?>
search_stats<?php echo $module->id; ?>();
<?php } ?>
$(".filter_loading<?php echo $module->id; ?>").show();
$(this).find(".inputbox, input[type=hidden]").each(function() {
if($(this).val() == '') {
$(this).attr("name", "");
}
});
setTimeout(function() {
$(".filter_loading<?php echo $module->id; ?>").hide();
}, 4000);
});

$("body").append("<div class='filter_loading<?php echo $module->id; ?>'>loading ...</div>");
});

function submit_form_<?php echo $module->id; ?>() {
if(sliderLock) return false;
<?php if($params->get("search_type") == "ajax") { ?>
ajax_results<?php echo $module->id; ?>();
return false;
<?php } ?>
jQuery("#GSearch<?php echo $module->id; ?> form").submit();
}


</script>

<?php
Expand Down

0 comments on commit 0288521

Please sign in to comment.