The next part of the
statement (
)
return
&& (theSelNode.nodeType == Node.TEXT_NODE
checks to see if the selected node type is text. If so, the
function
canAcceptCommand()
returns the value
. If the node type is not text, the test continues to see if the node has
true
children (
), and if the type of the first child node is text
|| theSelNode.hasChildNodes()
(
(
). If both conditions are true,
&&
theChildren[0].nodeType == Node.TEXT_NODE))
returns the value
, and Dreamweaver enables the menu item at the
canAcceptCommand()
true
bottom of the Commands menu, as shown in the following figure:
Otherwise,
returns the value
and Dreamweaver dims the item, as
canAcceptCommand()
false
shown in the following figure:
A simple Command example
141
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers