1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2026-03-16 23:55:46 +01:00

Removed Cookie dependency in TableFilter class

This commit is contained in:
Max Guglielmi 2016-01-18 17:11:33 +11:00
commit e5a67eeee9
12 changed files with 9905 additions and 41 deletions

View file

@ -21,6 +21,7 @@ export class Store{
init(){
this.emitter.on(['after-filtering'],
()=> this.saveFilterValues(this.tf.fltsValuesCookie));
this.emitter.on(['after-clearing-filters'], ()=> this.clearCookies());
}
/**
@ -43,8 +44,6 @@ export class Store{
}
fltValues.push(value);
}
//adds array size
//fltValues.push(tf.fltIds.length);
//writes cookie
Cookie.write(
@ -114,8 +113,18 @@ export class Store{
return Cookie.read(name);
}
/**
* Remove all cookies
*/
clearCookies(){
Cookie.remove(this.tf.fltsValuesCookie);
Cookie.remove(this.tf.pgLenCookie);
Cookie.remove(this.tf.pgNbCookie);
}
destroy(){
this.emitter.off(['after-filtering'],
()=> this.saveFilterValues(this.tf.fltsValuesCookie));
this.emitter.off(['after-clearing-filters'], ()=> this.clearCookies());
}
}