@allurereport/web-classic
Version:
The static files for Allure Classic Report
44 lines (36 loc) • 891 B
JavaScript
import { View } from "backbone.marionette";
import $ from "jquery";
import { className, on, regions } from "@/decorators/index.js";
import template from "./ModalView.hbs";
import "./styles.scss";
("modal")
({
content: ".modal__content",
})
class ModalView extends View {
template = template;
static container = $(document.body);
show() {
this.constructor.container.append(this.$el);
this.showChildView("content", this.options.childView);
$("#content").toggleClass("blur", true);
}
onDestroy() {
$("#content").toggleClass("blur", false);
}
("click .modal__content")
onKeepOpen(e) {
e.stopPropagation();
}
("click .modal__background, .modal__close")
onClose() {
this.destroy();
}
serializeData() {
return {
cls: this.className,
title: this.options.title,
};
}
}
export default ModalView;