showIf()
Availability
Adobe Dreamweaver MX.
Description
Specifies that an item appears on the toolbar only if the function returns a true value. For example, you can use the showIf() function to show certain buttons only when the page has a certain server model. If the showif() function is not defined, the item always appears. The showIf() function is the same as the showIf attribute in a toolbar item tag.
The showIf() function is called whenever the item's enabler runs; that is, according to the value that the getUpdateFrequency() function returns.
Arguments
None.
Returns
Adobe Dreamweaver expects a Boolean value: true if the item appears; false otherwise.
Example
function showif(){ var retval = false; var dom = dw.getDocumentDOM(); if(dom) { var view = dom.getView(); if(view == 'design') { retval = true; } } return retval;}