CSS
1
Вклад в тег
<TextBox x:Name="CategoryText"
TextChanged="ChangeText"
Style="{StaticResource CategoryTextBox}" />
public partial class FontWindow : Window
{
private MainWindow window;
public FontWindow(MainWindow mainWindow)
{
InitializeComponent();
window = mainWindow;
}
private void ChangeText(object sender, TextChangedEventArgs e)
{
TextBox tb = sender as TextBox;
window.CategoryLabel1.Content = tb.Text;
}
}
data:() ({
hasText: false
})
meathods: {
showText() {
this.hasText = true
}
hideText() {
this.hasText = false
}
}
<div class="flag flag--ru" @mouseover="showText" @mouseleave="hideText">
<svg>
<use xlink:href="@/assets/svg/svg.svg#flag-ru"></use>
</svg>
</div>
<p v-if="hasText">any text</p>
@PostMapping("/sketches/add")
public String addSketch(
@Valid Sketch sketch,
BindingResult result,
RedirectAttributes redirectAttributes) {
redirectAttributes.addFlashAttribute("action", "save");
if (result.hasErrors()) {
return "admin/add-sketch";
}
sketchRepository.save(sketch);
return "redirect:/admin/sketches/add";
}
<link rel="stylesheet" th:href="@{/libs/toastr/toastr.min.css}">
<script th:src="@{/libs/jquery/jquery-3.4.1.min.js}"></script>
<script defer th:src="@{/libs/toastr/toastr.min.js}"></script>
<script defer th:src="@{/js/add-sketch.js}"></script>
/*TOASTR OPTIONS*/
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-bottom-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "2000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
<script th:inline="javascript">
$(document).ready(function () {
var action = [[${action}]];
if (action === 'save') {
toastr["success"]("Success!")
}
});
</script>