IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
소스 검색

Fix modal dialog on history back press.

master
부모
커밋
8e4f93cae2
2개의 변경된 파일17개의 추가작업 그리고 10개의 파일을 삭제
  1. +7
    -2
      frontend/src/js/dialog/wb-browse-dialog.js
  2. +10
    -8
      frontend/src/js/widget/wb-dialog.js

+ 7
- 2
frontend/src/js/dialog/wb-browse-dialog.js 파일 보기

@@ -1,4 +1,4 @@
import { h, Component } from 'preact';
import { h, Component, createRef } from 'preact';
import WBBrowseDialogProjectList from 'wb-browse-dialog-project-list';
import WBBrowseDialogCollectionList from 'wb-browse-dialog-collection-list';
import WBBrowseDialogCollectionContent from 'wb-browse-dialog-collection-content';
@@ -44,6 +44,7 @@ class WBBrowseDialog extends Component {
this.state.textSearch = '';
this.state.id = ('id' in this.props) ? this.props.id : uuid.v4();
this.state.accept = () => {};
this.modalRef = createRef();
}
navigateBack() {
@@ -144,6 +145,10 @@ class WBBrowseDialog extends Component {
$('#' + this.state.id).modal();
}
componentWillUnmount() {
$(this.modalRef.current).modal('hide');
}
render({ app },
{ history, currentUrl, mode, uuid,
topPage, bottomPage, textSearch,
@@ -151,7 +156,7 @@ class WBBrowseDialog extends Component {
selectMany, selectWhat }) {
return (
<div class="modal" id={ id } tabindex="-1" role="dialog">
<div class="modal" id={ id } tabindex="-1" role="dialog" ref={ this.modalRef }>
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">


+ 10
- 8
frontend/src/js/widget/wb-dialog.js 파일 보기

@@ -1,25 +1,27 @@
import { h, Component } from 'preact';
import { h, Component, createRef } from 'preact';
class WBDialog extends Component {
constructor(...args) {
super(...args);
this.state.id = uuid.v4();
this.modalRef = createRef();
}
show() {
const { id } = this.state;
$('#' + id).modal();
$(this.modalRef.current).modal();
}
hide() {
const { id } = this.state;
$('#' + id).modal('hide');
$(this.modalRef.current).modal('hide');
}
render({ title, children, accept, reject }, { id }) {
componentWillUnmount() {
$(this.modalRef.current).modal('hide');
}
render({ title, children, accept, reject }) {
return (
<form class="m-0">
<div class="modal" id={ id } tabindex="-1" role="dialog">
<div class="modal" tabindex="-1" role="dialog" ref={ this.modalRef }>
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">


불러오는 중...
취소
저장