Last active
September 5, 2016 13:33
-
-
Save windmitry/283f7ebe529fe10fca285f44c4fc1fc3 to your computer and use it in GitHub Desktop.
Revisions
-
Dmitry renamed this gist
Sep 5, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Dmitry created this gist
Sep 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ Drupal.behaviors.webformPlaceholders = { attach:function (context, settings) { var text_search_default = Drupal.t("Enter Here"); var inputField = $("form.webform-client-form input[type='text']"); inputField.val(text_search_default); inputField.focus(function () { if ($(this).val() == text_search_default) { $(this).val('').addClass('active'); } }).blur(function () { if ($(this).val() == '') { $(this).val(text_search_default).removeClass('active'); } }); $("form.webform-client-form").submit(function () { if (inputField.val() == text_search_default) { inputField.val(''); } }); } } // Render a user image with the default image style render(field_view_field('user', $user, 'field_avatar')); // and a nodes image render(field_view_field('node', $node, 'field_image')); // Render with a custom image style, in this case named 'post_avatar' render(field_view_field('user', $user, 'field_avatar', array('settings' => array('image_style' => 'post_avatar'))));