From f031b04ea4f8530d47b21edccd044d3cb77f9db1 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 26 Jul 2017 11:45:46 +0200 Subject: [PATCH] New jQuery function to jump after load directly to form first field --- modules/nodecomment/includes/nodecomment.forms.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/nodecomment/includes/nodecomment.forms.inc b/modules/nodecomment/includes/nodecomment.forms.inc index d55563c..106f72d 100644 --- a/modules/nodecomment/includes/nodecomment.forms.inc +++ b/modules/nodecomment/includes/nodecomment.forms.inc @@ -90,6 +90,10 @@ function nodecomment_form_alter(&$form, &$form_state, $form_id) { '#value' => 1 ); } + + if (in_array($type, nodecomment_get_comment_types())) { + drupal_add_js('$jq(\'html\').delay(100).animate({scrollTop:$("#node-form").offset().top},2400);', 'inline', 'footer'); + } } function _nodecomment_alter_nodecomment_form(&$form, $node, $target_node = NULL, $target_comment = NULL) {