1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-01 21:42:20 +02:00
TableFilter/src/modules/feature.js
2015-11-15 21:20:40 +11:00

43 lines
768 B
JavaScript

const NOTIMPLEMENTED = 'Not implemented.';
export class Feature {
constructor(tf, feature) {
this.tf = tf;
this.feature = feature;
this.enabled = tf[feature];
this.config = tf.config();
this.initialized = false;
}
init() {
throw new Error(NOTIMPLEMENTED);
}
reset() {
if(!this.tf.hasGrid()){
return;
}
this.enable();
this.init();
}
destroy() {
throw new Error(NOTIMPLEMENTED);
}
enable() {
this.enabled = true;
this.tf[this.feature] = this.enabled;
}
disable() {
this.enabled = false;
this.tf[this.feature] = this.enabled;
}
isEnabled() {
return this.enabled;
}
}