about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/image_loader.js
diff options
context:
space:
mode:
authorMashiro <moezhx@outlook.com>2020-11-03 04:16:38 +0800
committerGitHub <noreply@github.com>2020-11-02 21:16:38 +0100
commit6a2db10f767879b9072b6c020ebadac4f985ed34 (patch)
tree2d126048ac0a7ff8d95db4b6b9beaefee947acef /app/javascript/mastodon/features/ui/components/image_loader.js
parent4b2ec4a2dc3348ff27f74f442e408d92075bf7c2 (diff)
Add expand/compress image button on image view box (#15068)
* add zoom image button

* enhance zoom algorithm & add translation

* code structure

* code structure

* code structure

* enhance grab performance

* rm useless state

* fix behavior on Firefox & scroll lock & horizontal scroll with mousewheel

* remove scroll lock on MouseWheelEvent

* code structure

* enhance algorithm and code structure

* rm Gemfile.lock from tree

* codeclimate

* fix a stupid mistake
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/image_loader.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/image_loader.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/ui/components/image_loader.js b/app/javascript/mastodon/features/ui/components/image_loader.js
index 5e1cf75af..c6f16a792 100644
--- a/app/javascript/mastodon/features/ui/components/image_loader.js
+++ b/app/javascript/mastodon/features/ui/components/image_loader.js
@@ -13,6 +13,7 @@ export default class ImageLoader extends React.PureComponent {
     width: PropTypes.number,
     height: PropTypes.number,
     onClick: PropTypes.func,
+    zoomButtonHidden: PropTypes.bool,
   }
 
   static defaultProps = {
@@ -151,6 +152,9 @@ export default class ImageLoader extends React.PureComponent {
             alt={alt}
             src={src}
             onClick={onClick}
+            width={width}
+            height={height}
+            zoomButtonHidden={this.props.zoomButtonHidden}
           />
         )}
       </div>