浏览代码

Make sure that only selecter or progress can access modal

Artur Paikin 9 年之前
父节点
当前提交
f7090e7350
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/plugins/FakeModal.js

+ 7 - 2
src/plugins/FakeModal.js

@@ -28,6 +28,13 @@ export default class FakeModal extends Plugin {
   }
 
   prepareTarget (callerPlugin) {
+    console.log(callerPlugin.type)
+
+    if (callerPlugin.type !== 'selecter' || callerPlugin.type !== 'progress') {
+      this.core.log('Error: Modal can only be used by plugins of type `selecter` or `progress`')
+      return
+    }
+
     const callerPluginName = callerPlugin.constructor.name
 
     // add tab panel
@@ -56,8 +63,6 @@ export default class FakeModal extends Plugin {
       </a></li>
     `
 
-    console.log('yoyoyoyoy')
-
     this.initEvents()
 
     return document.querySelector(`#${callerPluginName}`)