Ver Fonte

Fix issue with image focal point removal not working

Ensure we define jcropapi, fixing javascript TypeError.
Fixes #11254
Gunnar Scherf há 1 ano atrás
pai
commit
bd72828c5d

+ 1 - 0
CHANGELOG.txt

@@ -22,6 +22,7 @@ Changelog
  * Fix: Make Workflow and Aging Pages reports only available to users with page-related permissions (Rohit Sharma)
  * Fix: Make searching on specific fields work correctly on Elasticsearch when boost is in use (Matt Westcott)
  * Fix: Use a visible border and background color to highlight active formatting in the rich text toolbar (Cassidy Pittman)
+ * Fix: Ensure image focal point box can be removed (Gunnar Scherf)
  * Docs: Document, for contributors, the use of translate string literals passed as arguments to tags and filters using `_()` within templates (Chiemezuo Akujobi)
  * Docs: Document all features for the Documents app in one location (Neeraj Yetheendran)
  * Maintenance: Update BeautifulSoup upper bound to 4.12.x (scott-8)

+ 1 - 0
CONTRIBUTORS.md

@@ -769,6 +769,7 @@
 * Kehinde Bobade
 * Joe Tsoi
 * Cassidy Pittman
+* Gunnar Scherf
 
 ## Translators
 

+ 1 - 0
docs/releases/6.0.md

@@ -35,6 +35,7 @@ depth: 1
  * Make Workflow and Aging Pages reports only available to users with page-related permissions (Rohit Sharma)
  * Make searching on specific fields work correctly on Elasticsearch when boost is in use (Matt Westcott)
  * Use a visible border and background color to highlight active formatting in the rich text toolbar (Cassidy Pittman)
+ * Ensure image focal point box can be removed (Gunnar Scherf)
 
 ### Documentation
 

+ 3 - 0
wagtail/images/static_src/wagtailimages/js/focal-point-chooser.js

@@ -25,6 +25,9 @@ function setupJcrop(image, original, focalPointOriginal, fields) {
       },
     },
     function () {
+      // eslint-disable-next-line @typescript-eslint/no-this-alias
+      jcropapi = this;
+
       // Set alt="" on the image so its src is not read out loud to screen reader users.
       var $holderImage = $('img', this.ui.holder);
       $holderImage.attr('alt', '');