Skip to content

Commit

Permalink
Merge af68a2e into d1c9298
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahmey committed May 16, 2019
2 parents d1c9298 + af68a2e commit 4e42e49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/Frontend/Core/Js/frontend.js
Expand Up @@ -209,6 +209,21 @@ jsFrontend.forms = {
jsFrontend.forms.filled()
jsFrontend.forms.datePicker()
jsFrontend.forms.imagePreview()
jsFrontend.forms.requiredTooltip()
},

requiredTooltip: function () {
$(document).on('focus', '.form-control', function (event) {
var id = $(event.currentTarget).attr('id')

// show tooltip
$('label[for="' + id + '"]').find('abbr').tooltip('show')

// hide tooltip after 1 second
setTimeout(() => {
$('label[for="' + id + '"]').find('abbr').tooltip('hide')
}, 1000)
})
},

imagePreview: function () {
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/Core/Layout/Templates/Macros.html.twig
Expand Up @@ -18,7 +18,7 @@
{% endmacro %}

{% macro required() %}
<abbr tabindex="0" data-toggle="tooltip" aria-label="{{ 'lbl.RequiredField'|trans|ucfirst }}" title="{{ 'lbl.RequiredField'|trans|ucfirst }}">*</abbr>
<abbr data-toggle="tooltip" aria-label="{{ 'lbl.RequiredField'|trans|ucfirst }}" title="{{ 'lbl.RequiredField'|trans|ucfirst }}">*</abbr>
{% endmacro %}

{% macro icon(icon) %}
Expand Down

0 comments on commit 4e42e49

Please sign in to comment.