Created AbpAutoFocusTagHelper.

pull/301/head
Halil İbrahim Kalkan 7 years ago
parent 712c736ab0
commit b0f915754f

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Utils
{
[HtmlTargetElement(Attributes = "abp-auto-focus")]
public class AbpAutoFocusTagHelper : AbpTagHelper
{
[HtmlAttributeName("abp-auto-focus")]
public bool AutoFocus { get; set; }
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (AutoFocus)
{
output.Attributes.Add("data-auto-focus", "true");
}
}
}
}

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.If
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Utils
{
[HtmlTargetElement(Attributes = "abp-if")]
public class AbpIfTagHelper : AbpTagHelper

@ -72,6 +72,8 @@
});
$(function () {
enableFormFeatures($('form'));
$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
@ -80,7 +82,7 @@
container: 'body'
});
enableFormFeatures($('form'));
$('[data-auto-focus="true"]').first().findWithSelf('input').focus();
});
})(jQuery);
Loading…
Cancel
Save