Эх сурвалжийг харах

refactor: remove CVideo and CImage

Casper Dai 3 жил өмнө
parent
commit
1642b15ee8

+ 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) {