From 605a92b4607589c64acf9c5cb58d2fcc68e2606a Mon Sep 17 00:00:00 2001 From: unarist Date: Mon, 26 Mar 2018 19:48:01 +0900 Subject: Fix moved account handling in IndexedDB feature (#6915) * Fix stack overflow on importFetchedAccounts When the account has moved property, it should process destination account instead of source account itself. * Set account id instead of account object for moved property This restores "foo has moved to" indication on account view, and fixes `reblog` index on `accounts` object store. --- app/javascript/mastodon/actions/importer/index.js | 2 +- app/javascript/mastodon/actions/importer/normalizer.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/actions/importer/index.js b/app/javascript/mastodon/actions/importer/index.js index d1ea40c36..a97f4d173 100644 --- a/app/javascript/mastodon/actions/importer/index.js +++ b/app/javascript/mastodon/actions/importer/index.js @@ -39,7 +39,7 @@ export function importFetchedAccounts(accounts) { pushUnique(normalAccounts, normalizeAccount(account)); if (account.moved) { - processAccount(account); + processAccount(account.moved); } } diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js index c88f6946f..1b09f319f 100644 --- a/app/javascript/mastodon/actions/importer/normalizer.js +++ b/app/javascript/mastodon/actions/importer/normalizer.js @@ -10,6 +10,10 @@ export function normalizeAccount(account) { account.display_name_html = emojify(escapeTextContentForBrowser(displayName)); account.note_emojified = emojify(account.note); + if (account.moved) { + account.moved = account.moved.id; + } + return account; } -- cgit From f691afaae913fdb3041864b2824ca092e092ba84 Mon Sep 17 00:00:00 2001 From: Yuto Tokunaga Date: Mon, 26 Mar 2018 20:59:21 +0900 Subject: Refactor scss (#6913) * Refactoring scss introduce scss variables for the media modal fix css block structure corresponding to react components fix flex layouts remove background image of the loaded image on the media modal * Fix typo --- app/javascript/styles/mastodon/components.scss | 49 +++++++++++--------------- app/javascript/styles/mastodon/variables.scss | 5 +++ 2 files changed, 26 insertions(+), 28 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index ea6e39392..1fb1fa851 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1435,14 +1435,19 @@ position: relative; width: 100%; height: 100%; + display: flex; + align-items: center; + justify-content: center; - &.image-loader--loading { - display: flex; - align-content: center; + .image-loader__preview-canvas { + max-width: $media-modal-media-max-width; + max-height: $media-modal-media-max-height; + background: url('../images/void.png') repeat; + object-fit: contain; + } - .image-loader__preview-canvas { - filter: blur(2px); - } + &.image-loader--loading .image-loader__preview-canvas { + filter: blur(2px); } &.image-loader--amorphous .image-loader__preview-canvas { @@ -1455,7 +1460,16 @@ width: 100%; height: 100%; display: flex; - align-content: center; + align-items: center; + justify-content: center; + + img { + max-width: $media-modal-media-max-width; + max-height: $media-modal-media-max-height; + width: auto; + height: auto; + object-fit: contain; + } } .navigation-bar { @@ -3422,27 +3436,6 @@ a.status-card { width: 100%; height: 100%; position: relative; - - img, - canvas, - video { - max-width: 100%; - /* - put margins on top and bottom of image to avoid the screen coverd by - image. - */ - max-height: 80%; - width: auto; - height: auto; - margin: auto; - } - - img, - canvas { - display: block; - background: url('../images/void.png') repeat; - object-fit: contain; - } } .media-modal__closer { diff --git a/app/javascript/styles/mastodon/variables.scss b/app/javascript/styles/mastodon/variables.scss index dcc2857ff..e456c27ee 100644 --- a/app/javascript/styles/mastodon/variables.scss +++ b/app/javascript/styles/mastodon/variables.scss @@ -30,3 +30,8 @@ $ui-highlight-color: $classic-highlight-color !default; // Vibrant // Language codes that uses CJK fonts $cjk-langs: ja, ko, zh-CN, zh-HK, zh-TW; + +// Variables for components +$media-modal-media-max-width: 100%; +// put margins on top and bottom of image to avoid the screen covered by image. +$media-modal-media-max-height: 80%; -- cgit From 18965cb0e611b226c6252f1669f228f5b95f1ac6 Mon Sep 17 00:00:00 2001 From: Stephen Burgess Date: Mon, 26 Mar 2018 07:59:44 -0400 Subject: feat(ShowMore): Add classname to show more/show less button (#6904) --- app/javascript/mastodon/components/status_content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index b6082f008..9b86592f6 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -158,7 +158,7 @@ export default class StatusContent extends React.PureComponent { {mentionsPlaceholder} -- cgit