Attach the querycreator object to the annotation table object
Change-Id: Ia6bdd0f1dd786de4286633e83e872e41c590f148
diff --git a/dev/js/src/match/table.js b/dev/js/src/match/table.js
index 67e20cd..7aec5ad 100644
--- a/dev/js/src/match/table.js
+++ b/dev/js/src/match/table.js
@@ -1,9 +1,17 @@
/**
- * Table representation of morphological
+ * Table representation of token-based
* annotations of a match.
*/
-// TODO: Create base object for all matchinfo classes!
-define(["util"], function () {
+define([
+ 'match/querycreator',
+ "util"
+], function (matchQueryCreator) {
+ /*
+ * TODO:
+ * Create base object for all matchinfo classes!
+ * TODO:
+ * Rename to match/annotationtable
+ */
const _TermRE = new RegExp("^(?:([^\/]+?)\/)?([^:]+?):(.+?)$");
const d = document;
@@ -31,11 +39,15 @@
// Parse the snippet
this._parse(html.childNodes);
-
+
html.innerHTML = '';
return this;
},
-
+
+ // TODO: Destroy match!
+ destroy : function () {
+ this._matchCreator = undefined;
+ },
/**
* Length of the table (columns),
@@ -244,7 +256,10 @@
};
};
};
-
+
+ // Add query creator
+ this._matchCreator = matchQueryCreator.create(this._element);
+
return this._element;
},
};