This commit is contained in:
こぴなたみぽ 2017-11-13 08:53:38 +09:00
parent e53f2fd66e
commit 9483558372
2 changed files with 9 additions and 12 deletions

View file

@ -1,5 +1,5 @@
<mk-messaging-room-window> <mk-messaging-room-window>
<mk-window ref="window" is-modal={ false } width={ '500px' } height={ '560px' } popout-option={ popout }> <mk-window ref="window" is-modal={ false } width={ '500px' } height={ '560px' } popout={ popout }>
<yield to="header"><i class="fa fa-comments"></i>メッセージ: { parent.user.name }</yield> <yield to="header"><i class="fa fa-comments"></i>メッセージ: { parent.user.name }</yield>
<yield to="content"> <yield to="content">
<mk-messaging-room user={ parent.user }/> <mk-messaging-room user={ parent.user }/>
@ -23,11 +23,7 @@
this.user = this.opts.user; this.user = this.opts.user;
this.popout = { this.popout = `${CONFIG.url}/i/messaging/${this.user.username}`;
url: `${CONFIG.url}/i/messaging/${this.user.username}`,
width: 420,
height: 540
};
this.on('mount', () => { this.on('mount', () => {
this.refs.window.on('closed', () => { this.refs.window.on('closed', () => {

View file

@ -5,7 +5,7 @@
<header ref="header" onmousedown={ onHeaderMousedown }> <header ref="header" onmousedown={ onHeaderMousedown }>
<h1 data-yield="header"><yield from="header"/></h1> <h1 data-yield="header"><yield from="header"/></h1>
<div> <div>
<button class="popout" if={ popoutOption } onmousedown={ repelMove } onclick={ popout } title="ポップアウト"><i class="fa fa-external-link"></i></button> <button class="popout" if={ popoutUrl } onmousedown={ repelMove } onclick={ popout } title="ポップアウト"><i class="fa fa-external-link"></i></button>
<button class="close" if={ canClose } onmousedown={ repelMove } onclick={ close } title="閉じる"><i class="fa fa-times"></i></button> <button class="close" if={ canClose } onmousedown={ repelMove } onclick={ close } title="閉じる"><i class="fa fa-times"></i></button>
</div> </div>
</header> </header>
@ -194,8 +194,7 @@
this.isModal = this.opts.isModal != null ? this.opts.isModal : false; this.isModal = this.opts.isModal != null ? this.opts.isModal : false;
this.canClose = this.opts.canClose != null ? this.opts.canClose : true; this.canClose = this.opts.canClose != null ? this.opts.canClose : true;
this.popoutOption = this.opts.popoutOption; this.popoutUrl = this.opts.popout;
console.log(this.popoutOption);
this.isFlexible = this.opts.height == null; this.isFlexible = this.opts.height == null;
this.canResize = !this.isFlexible; this.canResize = !this.isFlexible;
@ -265,12 +264,14 @@
this.popout = () => { this.popout = () => {
const position = this.refs.main.getBoundingClientRect(); const position = this.refs.main.getBoundingClientRect();
const width = parseInt(getComputedStyle(this.refs.main, '').width, 10);
const left = parseInt(getComputedStyle(this.refs.main, '').left, 10);
const x = window.screenX + position.left; const x = window.screenX + position.left;
const y = window.screenY + position.top; const y = window.screenY + position.top;
window.open(this.popoutOption.url, window.open(this.popoutUrl,
this.popoutOption.url, this.popoutUrl,
`height=${this.popoutOption.height},width=${this.popoutOption.width},left=${x},top=${y}`); `height=${height},width=${width},left=${x},top=${y}`);
this.close(); this.close();
}; };