1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-14 12:27:05 +02:00
TableFilter/dist/TF_Modules/tf_watermark.js

27 lines
1.1 KiB
JavaScript

/*------------------------------------------------------------------------
- HTML Table Filter Generator
- Watermark feature v1.0
- By Max Guglielmi (tablefilter.free.fr)
- Licensed under the MIT License
-------------------------------------------------------------------------*/
TF.prototype.SetWatermark = function(set)
/*====================================================
- inserts or removes input watermark
- Params:
- set: if true inserts watermark (boolean)
=====================================================*/
{
if( !this.fltGrid ) return;
if(this.inpWatermark!=''){ //Not necessary if empty
var set = (set || set==undefined) ? true : false;
for(var i=0; i<this.fltIds.length; i++){
if(this['col'+i]!=this.fltTypeInp) continue; //only input type filters
var inpWatermark = (!this.isInpWatermarkArray ? this.inpWatermark : this.inpWatermark[i]);
if(this.GetFilterValue(i) == (set ? '' : inpWatermark)){
this.SetFilterValue(i,(!set ? '' : inpWatermark));
tf_AddClass(this.GetFilterElement(i), this.inpWatermarkCssClass);
}
}
}
}