diff --git a/ignite-tabs.js b/ignite-html-tabs.js
similarity index 85%
rename from ignite-tabs.js
rename to ignite-html-tabs.js
index fd2d12d..b83ab75 100644
--- a/ignite-tabs.js
+++ b/ignite-html-tabs.js
@@ -14,17 +14,19 @@ IgniteTemplate.prototype.tab = function(name, active = false) {
//the tabchange event is raised. Upon disconnecting the callback we remove
//the event listener.
var callback = new IgniteCallback(e => {
- if (e.tabName == name) {
- this.element.classList.remove("tab-inactive");
+ if (this.element) {
+ if (e.tabName == name) {
+ this.element.classList.remove("tab-inactive");
- if (!this.element.classList.contains("tab-active")) {
- this.element.classList.add("tab-active");
- }
- } else {
- this.element.classList.remove("tab-active");
+ if (!this.element.classList.contains("tab-active")) {
+ this.element.classList.add("tab-active");
+ }
+ } else {
+ this.element.classList.remove("tab-active");
- if (!this.element.classList.contains("tab-inactive")) {
- this.element.classList.add("tab-inactive");
+ if (!this.element.classList.contains("tab-inactive")) {
+ this.element.classList.add("tab-inactive");
+ }
}
}
}, () => {