소스 검색

refactor: remove CVideo and CImage

Casper Dai 3 년 전
부모
커밋
1642b15ee8
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      src/views/bigscreen/ast/core/utils.js

+ 7 - 3
src/views/bigscreen/ast/core/utils.js

@@ -19,14 +19,18 @@ export const widgets = Object.freeze([
   widgetMedia,
   widgetText,
   widgetMarquee,
-  widgetImage,
-  widgetVideo,
   widgetTime,
   __STAGING__ ? widgetWeather : null,
   widgetWeb,
   widgetLive
 ].filter(Boolean))
 
+const supportWidgets = Object.freeze([
+  ...widgets,
+  widgetImage,
+  widgetVideo
+].filter(Boolean))
+
 let scale = null
 export function create (node) {
   const canvasDefaults = widgetCanvas.defaults()
@@ -86,7 +90,7 @@ export function copy ({ id, ...node }) {
 }
 
 function getWidget (type) {
-  return type && widgets.find(widget => widget.type === type) || {}
+  return type && supportWidgets.find(widget => widget.type === type) || {}
 }
 
 export function getIcon (type) {