getTopPos : function(inputObj)\r
{ \r
var returnValue = inputObj.offsetTop;\r
+ if (returnValue > 700) returnValue = 0;\r
while((inputObj = inputObj.offsetParent) != null){\r
if(inputObj.tagName!='HTML'){\r
returnValue += (inputObj.offsetTop - inputObj.scrollTop);\r
var cssPrefix; // Css prefix for the menu items.\r
var modelItemRef; // Reference to menuModelItem\r
\r
- this.layoutCSS = 'menu-item.css';\r
+// this.layoutCSS = 'menu-item.css';\r
this.cssPrefix = 'DHTMLSuite_';\r
\r
if(!standardObjectsCreated)DHTMLSuite.createStandardObjects(); \r
*/\r
createItem : function(menuModelItemObj)\r
{\r
- DHTMLSuite.commonObj.loadCSS(this.layoutCSS); // Load css\r
+// DHTMLSuite.commonObj.loadCSS(this.layoutCSS); // Load css\r
\r
DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[this.objectIndex] = this;\r
\r
}else{ \r
/* Add events */\r
var tmpVar = this.objectIndex/1;\r
- this.divElement.onclick = function(e) { DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[tmpVar].__navigate(e); }\r
+ //this.divElement.onclick = function(e) { DHTMLSuite.variableStorage.arrayOfDhtmlSuiteObjects[tmpVar].__navigate(e); }\r
this.divElement.onmousedown = this.__clickMenuItem; // on mouse down effect\r
this.divElement.onmouseup = this.__rolloverMenuItem; // on mouse up effect\r
this.divElement.onmouseover = this.__rolloverMenuItem; // mouse over effect\r
parentEl.style.backgroundPosition = 'left center'; \r
}\r
if(this.modelItemRef.itemText){\r
- var div = document.createElement('DIV');\r
+ var div;\r
+ if( this.modelItemRef.url )\r
+ {\r
+ div = document.createElement('a');\r
+ div.href = this.modelItemRef.url;\r
+ div.target = this.modelItemRef.frameTarget;\r
+ div.style.display = 'block';\r
+ }\r
+ else\r
+ div = document.createElement('div');\r
+ \r
div.className = 'DHTMLSuite_textContent';\r
div.innerHTML = this.modelItemRef.itemText; \r
div.className = this.cssPrefix + 'menuItem_textContent';\r
var globalObjectIndex; // Global index of this object - used to refer to the object of this class outside\r
this.cssPrefix = 'DHTMLSuite_';\r
this.menuItemLayoutCss = false; // false = use default for the menuItem class.\r
- this.layoutCSS = 'menu-bar.css';\r
+// this.layoutCSS = 'menu-bar.css';\r
this.menuBarBackgroundImage = 'menu_strip_bg.jpg';\r
this.menuItem_objects = new Array();\r
DHTMLSuite.variableStorage.menuBar_highlightedItems = new Array();\r
this.targetId = false;\r
this.activeSubItemsOnMouseOver = false;\r
this.menuItemCssPrefix = false;\r
- this.createIframesForOldIeBrowsers = true;\r
+ this.createIframesForOldIeBrowsers = false;\r
if(!standardObjectsCreated)DHTMLSuite.createStandardObjects(); \r
\r
\r
init : function()\r
{\r
\r
- DHTMLSuite.commonObj.loadCSS(this.layoutCSS); \r
+// DHTMLSuite.commonObj.loadCSS(this.layoutCSS); \r
this.__createDivs(); // Create general divs\r
this.__createMenuItems(); // Create menu items\r
this.__setBasicEvents(); // Set basic events.\r
try{\r
var shortRef = this.submenuGroups[parentId]; \r
\r
+ if( shortRef.style.visible == 'hidden' )\r
+ {\r
+ shortRef.style.display = 'none';\r
+ return;\r
+ }\r
+ else\r
+ shortRef.style.display = 'block';\r
+ \r
var depth = this.menuItems[parentId].depth;\r
var dir = this.menuItemObj.submenuType[depth];\r
if(dir=='top'){ \r
shortRef.style.left = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + 'px';\r
shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetHeight) + 'px';\r
}else{\r
+ var too_large = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement)\r
+ + this.menuItem_objects[parentId].divElement.offsetWidth\r
+ + shortRef.offsetWidth\r
+ > $('#main_menu_div').width();\r
+ if (too_large)\r
+ shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) - shortRef.offsetWidth) + 'px';\r
+ else\r
shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetWidth) + 'px';\r
shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement)) + 'px'; \r
} \r
// }}} \r
,\r
unsetMenuBarState : function() { this.menuBarState = false },\r
+ changeMenuBarState: function (target) {\r
+ var parentId = target.id.replace(/[^0-9]/gi,'');\r
+ this.menuBarState = !this.menuBarState;\r
+ this.hideSubMenus();\r
+ if(this.menuBarState) {\r
+ this.__expandGroup(parentId);\r
+ }\r
+ },\r
// {{{ __setBasicEvents()\r
/**\r
* Set basic events for the menu widget.\r
*/ \r
__setBasicEvents : function()\r
{\r
- DHTMLSuite.commonObj.addEvent(document.documentElement,"click",this.hideSubMenus); \r
var menu = this;\r
- $(document).mousedown(function(){ menu.unsetMenuBarState(); });\r
- $('#win1').load(function(){\r
- $('#win1').contents().mousedown(function(){\r
- menu.hideSubMenus();\r
- menu.menuBarState = false;\r
- });\r
- })\r
+ $('div.DHTMLSuite_menuBar_sub').click(function() { menu.hideSubMenus(); menu.unsetMenuBarState() });\r
+ $('div.DHTMLSuite_menuBar_top > div > div[objectref!="0"]').click(function() { menu.changeMenuBarState(this) });\r
+ $('div.DHTMLSuite_menuBar_top').click(function(e) {\r
+ if ($(e.target).attr('class') == 'DHTMLSuite_menuBar_top') { menu.hideSubMenus(); menu.unsetMenuBarState() }\r
+ });\r
+ $('#content').mousedown(function(){\r
+ menu.hideSubMenus();\r
+ menu.menuBarState = false;\r
+ });\r
}\r
}\r
\r