Macromedia dreamweaver 8-extending dreamweaver User Manual
242
Toolbars
getMenuID()
Availability
Dreamweaver MX.
Description
Only valid for menu buttons. Dreamweaver calls the
getMenuID()
function to get the ID of
the menu that should appear when the user clicks the button.
Arguments
None.
Returns
Dreamweaver expects a string that contains a menu ID, which is defined in the menus.xml
file.
file.
Example
function getMenuID()
{
{
var dom = dw.getDocumentDOM();
var menuID = '';
if (dom)
{
var menuID = '';
if (dom)
{
var view = dom.getView();
var focus = dw.getFocus();
if (view == 'design')
{
var focus = dw.getFocus();
if (view == 'design')
{
menuID = 'DWDesignOnlyOptionsPopup';
}
else if (view == 'split')
{
else if (view == 'split')
{
if (focus == 'textView')
{
{
menuID = 'DWSplitCodeOptionsPopup';
}
else
{
else
{
menuID = 'DWSplitDesignOptionsPopup';
}
}
else if (view == 'code')
{
else if (view == 'code')
{
menuID = 'DWCodeOnlyOptionsPopup';
}
else
{
else
{