add function to check if context has specified context

This commit is contained in:
Jonathan Rainville 2018-04-25 10:57:23 -04:00
parent f39acbdd42
commit fba491592d
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,10 @@ Plugin.prototype.isContextValid = function() {
}); });
}; };
Plugin.prototype.hasContext = function(context) {
return this.currentContext.includes(context);
};
Plugin.prototype.loadPlugin = function() { Plugin.prototype.loadPlugin = function() {
if (!this.isContextValid()) { if (!this.isContextValid()) {
console.log(this.acceptedContext); console.log(this.acceptedContext);