Editor check whether field is hidden
Editor check whether field is hidden

I use this a lot with all kinds of editor fields:
editor.hide( ["predecessor[].prefixed_id"] );
Now I want to update the options of this field but only if it visible and wasn't programatically hidden.
I didn't find this visibility check in the api and had to code my own which was really cumbersome and looks like this
.....
if ( $('.' + $.escapeSelector('DTE_Field_Name_predecessor[].prefixed_id')).css('display') == 'none' ) {
return;
}
editor.field('predecessor[].prefixed_id').update ( options, false );
Could you provide a method to do this with the api. Something like this would be great:
if ( editor.hidden( ["predecessor[].prefixed_id"] ) ) {
return;
}
This discussion has been closed.
Replies
Two ways to do it with the existing API:
1)
displayed()
will list the currently displayed fields, so you could use:2) Or if you prefer a more DOM / jQuery method:
Allan
thanks, Allan!
displayed() is precisely what I was looking for!
Roland