html5smartimage 上的清除按钮是什么

What is the clear button on html5smartimage

我继承了一个包含 html5smartimage 组件的脚手架表单。这用于允许用户 select 此页面的显示图像。

(我知道这不是这个组件的设计目的,但我不知道用户使用的是什么功能,我们指定了高度。)

配置信息如下:

    <featuredImage
        jcr:primaryType="cq:Widget"
        allowUpload="false"
        ddGroups="[media]"
        disableZoom="{Boolean}true"
        fileNameParameter="./jcr:content/data/image/fileName"
        fileReferenceParameter="./jcr:content/data/image/fileReference"
        name="./jcr:content/data/image"
        title="Featured Image"
        height="400"
        xtype="html5smartimage"/>

添加图像后,会出现一个带有画笔图片的清除按钮,用于扫除某些东西。我假设它在那里清除图像,但它总是被禁用。

我在任何文档中都找不到这个清除按钮。

根据下面的答案,我构建了以下解决我的问题的方法:

    <featuredImage
        jcr:primaryType="cq:Widget"
        allowUpload="false"
        ddGroups="[media]"
        disableZoom="{Boolean}true"
        fileNameParameter="./jcr:content/data/image/fileName"
        fileReferenceParameter="./jcr:content/data/image/fileReference"
        name="./jcr:content/data/image"
        title="Featured Image"
        height="400"
        xtype="html5smartimage">
      <listeners
        jcr:primaryType="nt:unstructured"
        imagestate="function(imageComponent, state) {
                      if(state == 'originalavailable' || state == 'processedavailable') {
                          imageComponent.enableToolbar();
                      }
                    }"/>
    </featuredImage>

我在使用自定义小部件而不是脚手架表单时遇到了类似的问题。然而,修复应该也适用于此。

如下所示为您的图片添加一个监听器

listeners: {
    imagestate: function(imageComponent, state) {
        if(state == 'originalavailable' || state == 'processedavailable') {
            imageComponent.enableToolbar();
        }
    }
}

当您将图像拖放到对话框中时,这将启用清除按钮。