Skip to content

Commit 8b1d76d

Browse files
committed
Error when mounting duplicate plugins
1 parent 88838bf commit 8b1d76d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/PluginManager.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ export default {
1212
plugin[option] = defaults[option];
1313
}
1414
}
15+
16+
plugins.forEach(p => {
17+
if (p.pluginName === plugin.pluginName) {
18+
throw (`Sortable: Cannot mount plugin ${ plugin.pluginName } more than once`);
19+
}
20+
});
21+
1522
plugins.push(plugin);
1623
},
1724
pluginEvent(eventName, sortable, evt) {

0 commit comments

Comments
 (0)