summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/tags/messaging/index.tag16
-rw-r--r--src/web/app/desktop/tags/drive/browser-window.tag15
-rw-r--r--src/web/app/desktop/tags/window.tag6
3 files changed, 30 insertions, 7 deletions
diff --git a/src/web/app/common/tags/messaging/index.tag b/src/web/app/common/tags/messaging/index.tag
index 4c1bf0c6e4..aebcec9d8d 100644
--- a/src/web/app/common/tags/messaging/index.tag
+++ b/src/web/app/common/tags/messaging/index.tag
@@ -31,7 +31,8 @@
</a>
</virtual>
</div>
- <p class="no-history" if={ history.length == 0 }>%i18n:common.tags.mk-messaging.no-history%</p>
+ <p class="no-history" if={ !fetching && history.length == 0 }>%i18n:common.tags.mk-messaging.no-history%</p>
+ <p class="fetching" if={ fetching }><i class="fa fa-spinner fa-pulse fa-fw"></i>%i18n:common.loading%<mk-ellipsis/></p>
<style>
:scope
display block
@@ -297,6 +298,15 @@
color #999
font-weight 500
+ > .fetching
+ margin 0
+ padding 16px
+ text-align center
+ color #aaa
+
+ > i
+ margin-right 4px
+
// TODO: element base media query
@media (max-width 400px)
> .search
@@ -329,6 +339,8 @@
this.connectionId = this.messagingIndexStream.use();
this.searchResult = [];
+ this.history = [];
+ this.fetching = true;
this.registerMessage = message => {
message.is_me = message.user_id == this.I.id;
@@ -342,7 +354,7 @@
this.connection.on('read', this.onRead);
this.api('messaging/history').then(history => {
- this.isLoading = false;
+ this.fetching = false;
history.forEach(message => {
this.registerMessage(message);
});
diff --git a/src/web/app/desktop/tags/drive/browser-window.tag b/src/web/app/desktop/tags/drive/browser-window.tag
index dc55371da6..b5f368f1f4 100644
--- a/src/web/app/desktop/tags/drive/browser-window.tag
+++ b/src/web/app/desktop/tags/drive/browser-window.tag
@@ -1,11 +1,11 @@
<mk-drive-browser-window>
- <mk-window ref="window" is-modal={ false } width={ '800px' } height={ '500px' }>
+ <mk-window ref="window" is-modal={ false } width={ '800px' } height={ '500px' } popout={ popout }>
<yield to="header">
<p class="info" if={ parent.usage }><b>{ parent.usage.toFixed(1) }%</b> %i18n:desktop.tags.mk-drive-browser-window.used%</p>
<i class="fa fa-cloud"></i>%i18n:desktop.tags.mk-drive-browser-window.drive%
</yield>
<yield to="content">
- <mk-drive-browser multiple={ true } folder={ parent.folder }/>
+ <mk-drive-browser multiple={ true } folder={ parent.folder } ref="browser"/>
</yield>
</mk-window>
<style>
@@ -28,10 +28,21 @@
</style>
<script>
+ import CONFIG from '../../../common/scripts/config';
+
this.mixin('api');
this.folder = this.opts.folder ? this.opts.folder : null;
+ this.popout = () => {
+ const folder = this.refs.window.refs.browser.folder;
+ if (folder) {
+ return `${CONFIG.url}/i/drive/folder/${folder.id}`;
+ } else {
+ return `${CONFIG.url}/i/drive`;
+ }
+ };
+
this.on('mount', () => {
this.refs.window.on('closed', () => {
this.unmount();
diff --git a/src/web/app/desktop/tags/window.tag b/src/web/app/desktop/tags/window.tag
index da4ce0d6d2..ef77b70536 100644
--- a/src/web/app/desktop/tags/window.tag
+++ b/src/web/app/desktop/tags/window.tag
@@ -138,7 +138,6 @@
pointer-events none
display block
margin 0 auto
- width s('calc(100% - (%s * 2))', $header-height)
overflow hidden
text-overflow ellipsis
text-align center
@@ -269,8 +268,9 @@
const x = window.screenX + position.left;
const y = window.screenY + position.top;
- window.open(this.popoutUrl,
- this.popoutUrl,
+ const url = typeof this.popoutUrl == 'function' ? this.popoutUrl() : this.popoutUrl;
+
+ window.open(url, url,
`height=${height},width=${width},left=${x},top=${y}`);
this.close();