From 28407ce87b3c90cee9a735728e80aaeb730e4f34 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Nov 2017 05:25:07 +0900 Subject: [PATCH] :v: --- .../app/desktop/tags/home-widgets/activity.tag | 14 +++++++++++--- .../desktop/tags/home-widgets/notifications.tag | 17 +++++++++++++++-- .../desktop/tags/home-widgets/photo-stream.tag | 16 +++++++++++++--- .../app/desktop/tags/home-widgets/server.tag | 14 +++++++++++--- .../tags/home-widgets/user-recommendation.tag | 17 ++++++++++++++--- src/web/app/desktop/tags/home.tag | 17 +++++++++++++++-- 6 files changed, 79 insertions(+), 16 deletions(-) diff --git a/src/web/app/desktop/tags/home-widgets/activity.tag b/src/web/app/desktop/tags/home-widgets/activity.tag index ecb18992b..255f6442e 100644 --- a/src/web/app/desktop/tags/home-widgets/activity.tag +++ b/src/web/app/desktop/tags/home-widgets/activity.tag @@ -1,6 +1,8 @@ -

%i18n:desktop.tags.mk-activity-home-widget.title%

- + +

%i18n:desktop.tags.mk-activity-home-widget.title%

+ +

%i18n:common.loading%

@@ -51,7 +53,8 @@
diff --git a/src/web/app/desktop/tags/home-widgets/notifications.tag b/src/web/app/desktop/tags/home-widgets/notifications.tag index b1170855a..b068350de 100644 --- a/src/web/app/desktop/tags/home-widgets/notifications.tag +++ b/src/web/app/desktop/tags/home-widgets/notifications.tag @@ -1,6 +1,8 @@ -

%i18n:desktop.tags.mk-notifications-home-widget.title%

- + +

%i18n:desktop.tags.mk-notifications-home-widget.title%

+ +
diff --git a/src/web/app/desktop/tags/home-widgets/photo-stream.tag b/src/web/app/desktop/tags/home-widgets/photo-stream.tag index d1f29589f..7f8dd8563 100644 --- a/src/web/app/desktop/tags/home-widgets/photo-stream.tag +++ b/src/web/app/desktop/tags/home-widgets/photo-stream.tag @@ -1,5 +1,7 @@ -

%i18n:desktop.tags.mk-photo-stream-home-widget.title%

+ +

%i18n:desktop.tags.mk-photo-stream-home-widget.title%

+

%i18n:common.loading%

0 }> @@ -55,8 +57,11 @@ diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag index 5fcaa9b7d..b2e3b9d90 100644 --- a/src/web/app/desktop/tags/home-widgets/server.tag +++ b/src/web/app/desktop/tags/home-widgets/server.tag @@ -1,6 +1,8 @@ -

%i18n:desktop.tags.mk-server-home-widget.title%

- + +

%i18n:desktop.tags.mk-server-home-widget.title%

+ +

%i18n:common.loading%

@@ -57,7 +59,8 @@ import Connection from '../../../common/scripts/server-stream'; this.data = { - view: 0 + view: 0, + compact: false }; this.mixin('widget'); @@ -85,6 +88,11 @@ // Save widget state this.save(); }; + + this.func = () => { + this.data.compact = !this.data.compact; + this.save(); + };
diff --git a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag index f78d7944f..bb6f7c411 100644 --- a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag +++ b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag @@ -1,6 +1,8 @@ -

%i18n:desktop.tags.mk-user-recommendation-home-widget.title%

- + +

%i18n:desktop.tags.mk-user-recommendation-home-widget.title%

+ +
@@ -213,11 +215,22 @@ break; } - this.home.push(riot.mount(el, { + const tag = riot.mount(el, { id: widget.id, data: widget.data, tl: this.refs.tl - })[0]); + })[0]; + + this.home.push(tag); + + if (this.opts.customize) { + actualEl.oncontextmenu = e => { + e.preventDefault(); + e.stopImmediatePropagation(); + if (tag.func) tag.func(); + return false; + }; + } }; this.addWidget = () => {