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:
parent
885b957d31
commit
e5a67eeee9
12 changed files with 9905 additions and 41 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue