浏览代码

Add getIntegration() method.

panr 5 年之前
父节点
当前提交
204008a412
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      packages/ckeditor5-image/src/imageupload/ui/imageuploadpanelview.js

+ 13 - 0
packages/ckeditor5-image/src/imageupload/ui/imageuploadpanelview.js

@@ -139,6 +139,8 @@ export default class ImageUploadPanelView extends View {
 					} );
 				}
 
+				integrationView.name = integration;
+
 				this._integrations.add( integrationView );
 			}
 		}
@@ -214,6 +216,17 @@ export default class ImageUploadPanelView extends View {
 	}
 
 	/**
+	 * Returns a view for the integration.
+	 *
+	 * @param {string} name The name of the integration.
+	 *
+	 * @returns {module:ui/view~View}
+	 */
+	getIntegration( name ) {
+		return this._integrations.find( integration => integration.name === name );
+	}
+
+	/**
 	 * Creates dropdown view.
 	 *
 	 * @param {module:utils/locale~Locale} locale The localization services instance.