Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
@model Hawksearch.Kentico.Xperience.UI.Widgets.SearchBoxViewModel

@{
    var trackedEvents = new List<string>()
{
        Model.ComponentViewModel.Properties.TrackAutocompleteClickEvent ? "AutocompleteClick" : "",
        Model.ComponentViewModel.Properties.TrackSearchEvent ? "Search" : ""
    };

    var eventsJson = Newtonsoft.Json.JsonConvert.SerializeObject(trackedEvents.Where(a => !string.IsNullOrEmpty(a)));
    var settingsJson = Newtonsoft.Json.JsonConvert.SerializeObject(Model.ConnectorSettings);
}

<div class="vue-app-wrapper-ae"
style="display:flex;"
     data-indexname="@Model.ComponentViewModel.Properties.IndexName"
     data-trackedevents="@eventsJson"
     data-hawksearchsettings="@settingsJson">
    <div class="hawk">
        <div class="hawk__header">
            @if (string.IsNullOrWhiteSpace(Model.SearchPageUrl))
            {
                <search-box></search-box>
            }
            else
            {
                <search-box search-page="@Model.SearchPageUrl"></search-box>
            }
        </div>
    </div>
</div>

...