details: /erp/devel/pi/rev/8fd835841829
changeset: 6540:8fd835841829
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Mon Mar 01 15:27:14 2010 +0100
summary: Added show/hide left tab bar icon show/hide capabilities
diffstat:
src/org/openbravo/erpCommon/security/Login_F1.html | 2 +-
src/org/openbravo/erpCommon/security/Login_FS.html | 1 +
web/js/utils.js | 115 ++++++++++++++++++--
web/skins/Default/Openbravo_ERP_250.css | 20 +++
4 files changed, 123 insertions(+), 15 deletions(-)
diffs (251 lines):
diff -r 28dfbc300ac0 -r 8fd835841829
src/org/openbravo/erpCommon/security/Login_F1.html
--- a/src/org/openbravo/erpCommon/security/Login_F1.html Mon Mar 01
14:40:39 2010 +0100
+++ b/src/org/openbravo/erpCommon/security/Login_F1.html Mon Mar 01
15:27:14 2010 +0100
@@ -88,7 +88,7 @@
clearForm();
} catch (e) {}
setWindowElementFocus('firstElement');
- if ((!revisionControl('6531')) || (isOpsInstance() !=
isOpsInstanceCached())) {
+ if ((!revisionControl('6538')) || (isOpsInstance() !=
isOpsInstanceCached())) {
alert("Your browser's cache has outdated files. Please clean it and
reload the page.");
}
diff -r 28dfbc300ac0 -r 8fd835841829
src/org/openbravo/erpCommon/security/Login_FS.html
--- a/src/org/openbravo/erpCommon/security/Login_FS.html Mon Mar 01
14:40:39 2010 +0100
+++ b/src/org/openbravo/erpCommon/security/Login_FS.html Mon Mar 01
15:27:14 2010 +0100
@@ -23,6 +23,7 @@
<link rel="shortcut icon" href="../../../../../web/images/favicon.ico"
type="image/x-icon" />
<script language="JavaScript" type="text/javascript">
var isMenuHide = false;
+ var isMenuBlock = false;
var isRTL = false;
var menuWidth = '25%';
</script>
diff -r 28dfbc300ac0 -r 8fd835841829 web/js/utils.js
--- a/web/js/utils.js Mon Mar 01 14:40:39 2010 +0100
+++ b/web/js/utils.js Mon Mar 01 15:27:14 2010 +0100
@@ -74,7 +74,7 @@
* Return a number that would be checked at the Login screen to know if the
file is cached with the correct version
*/
function getCurrentRevision() {
- var number = '6531';
+ var number = '6538';
return number;
}
@@ -1812,6 +1812,28 @@
}
/**
+* Returns the object parent of a HTML object
+* @param {obj} object
+* @returns the object if exist. Else it returns false
+* @type Object
+*/
+function getObjParent(obj) {
+ try {
+ obj = obj.parentNode;
+ for (;;) {
+ if (obj.nodeType != '1') {
+ obj = obj.parentNode;
+ } else {
+ break;
+ }
+ }
+ return obj;
+ } catch(e) {
+ return false;
+ }
+}
+
+/**
* Fills a combo with a data from an Array. Allows to set a default selected
item, defined as boolean field in the Array.
* @param {Object} combo A reference to the combo object.
* @param {Array} dataArray Array containing the data for the combo. The
structure of the array must be value, text, selected. Value is value of the
item, text the string that will show the combo, an selected a boolean value to
set if the item should appear selected.
@@ -2200,23 +2222,76 @@
/**
* Function Description
+* Hides the button to show/hide the menu
+* @param {String} id The ID of the element
+*/
+function hideMenuIcon(id) {
+ var imgTag = document.getElementById(id);
+ var aTag = getObjParent(imgTag);
+ if (parent.frameMenu) {
+ getFrame('main').isMenuBlock=true;
+ }
+ if (aTag.className.indexOf("Main_LeftTabsBar_ButtonLeft_hidden") == -1) {
+ aTag.className = "Main_LeftTabsBar_ButtonLeft_hidden";
+ imgTag.className = "Main_LeftTabsBar_ButtonLeft_Icon";
+ disableAttributeWithFunction(aTag, 'obj', 'onclick');
+ }
+}
+
+/**
+* Function Description
+* Shows the button to show/hide the menu
+* @param {String} id The ID of the element
+*/
+function showMenuIcon(id) {
+ var imgTag = document.getElementById(id);
+ var aTag = getObjParent(imgTag);
+ if (parent.frameMenu) {
+ getFrame('main').isMenuBlock=false;
+ }
+ if (aTag.className.indexOf("Main_LeftTabsBar_ButtonLeft_hidden") != -1) {
+ aTag.className = "Main_LeftTabsBar_ButtonLeft";
+ imgTag.className = "Main_LeftTabsBar_ButtonLeft_Icon
Main_LeftTabsBar_ButtonLeft_Icon_arrow_hide";
+ enableAttributeWithFunction(aTag, 'obj', 'onclick');
+ updateMenuIcon(id);
+ }
+}
+
+/**
+* Function Description
* Shows or hides a window in the application
* @param {String} id The ID of the element
* @returns True if the operation was made correctly, false if not.
* @see #changeClass
*/
function updateMenuIcon(id) {
- if (!parent.frameMenu) return false;
+ if (!parent.frameMenu) {
+ hideMenuIcon(id);
+ return false;
+ }
else {
var frameContainer = getFrame('main');
var framesetMenu = frameContainer.document.getElementById("framesetMenu");
if (!framesetMenu) return false;
try {
- if (frameContainer.isMenuHide==true) changeClass(id, "_hide", "_show",
true);
- else changeClass(id, "_show", "_hide", true);
- } catch (ignored) {}
+ if (frameContainer.isMenuBlock==true) {
+ menuHide(id, false);
+ hideMenuIcon(id);
+ } else {
+ showMenuIcon(id);
+ }
+ } catch (ignored) {
+ }
+ try {
+ if (frameContainer.isMenuHide==true &&
frameContainer.isMenuBlock==false) {
+ changeClass(id, "_hide", "_show", true);
+ } else {
+ changeClass(id, "_show", "_hide", true);
+ }
+ } catch (ignored) {
+ }
return true;
- }
+ }
}
/**
@@ -2247,7 +2322,11 @@
* @returns True if the operation was made correctly, false if not.
* @see #changeClass
*/
-function menuShow(id) {
+function menuShow(id, updateIcon) {
+ if (typeof updateIcon === "undefined" || updateIcon === null || updateIcon
=== "null" || updateIcon === "") {
+ updateIcon = true;
+ }
+
if (!parent.frameMenu) {
window.open(baseFrameServlet, "_blank");
} else {
@@ -2269,9 +2348,11 @@
putFocusOnMenu();
} catch(e) {
}
- try {
- updateMenuIcon(id);
- } catch (e) {}
+ if (updateIcon != false) {
+ try {
+ updateMenuIcon(id);
+ } catch (e) {}
+ }
return true;
}
}
@@ -2283,7 +2364,11 @@
* @returns True if the operation was made correctly, false if not.
* @see #changeClass
*/
-function menuHide(id) {
+function menuHide(id, updateIcon) {
+ if (typeof updateIcon === "undefined" || updateIcon === null || updateIcon
=== "null" || updateIcon === "") {
+ updateIcon = true;
+ }
+
if (!parent.frameMenu) {
window.open(baseFrameServlet, "_blank");
} else {
@@ -2305,9 +2390,11 @@
putFocusOnWindow();
} catch(e) {
}
- try {
- updateMenuIcon(id);
- } catch (e) {}
+ if (updateIcon != false) {
+ try {
+ updateMenuIcon(id);
+ } catch (e) {}
+ }
return true;
}
}
diff -r 28dfbc300ac0 -r 8fd835841829 web/skins/Default/Openbravo_ERP_250.css
--- a/web/skins/Default/Openbravo_ERP_250.css Mon Mar 01 14:40:39 2010 +0100
+++ b/web/skins/Default/Openbravo_ERP_250.css Mon Mar 01 15:27:14 2010 +0100
@@ -5660,11 +5660,29 @@
border: 0px;
vertical-align: middle;
-moz-outline-style: none;
+ outline: none;
background-repeat: no-repeat;
background-position: center center;
background-image: url(Main/LeftTabsBar/leftbutton.normal.png); /**
sprite-ref: xxspritexx_V; sprite-alignment-ltr: left; */
}
+a.Main_LeftTabsBar_ButtonLeft_hidden {
+ display: block;
+ margin-left: 0px;
+ margin-right: 0px;
+ width: 25px;
+ height: 44px;
+ border: 0px;
+ vertical-align: middle;
+ -moz-outline-style: none;
+ outline: none;
+ text-decoration: none;
+ cursor: default;
+ background-repeat: repeat-y;
+ background-position: top left;
+ background-image: url(Main/LeftTabsBar/backgroundBorder.png); /**
sprite-ref: xxspritexx_H; sprite-alignment-ltr: repeat; */
+}
+
a.Main_LeftTabsBar_ButtonLeft:visited {
}
@@ -5727,6 +5745,7 @@
border: 0px;
vertical-align: middle;
-moz-outline-style: none;
+ outline: none;
background-repeat: no-repeat;
background-position: center center;
background-image: url(Main/LeftTabsBar/rightbutton.normal.png); /**
sprite-ref: xxspritexx_V; sprite-alignment-ltr: left; */
@@ -5745,6 +5764,7 @@
background-position: center center;
background-image: url(Main/LeftTabsBar/rightbutton.pressed.png); /**
sprite-ref: xxspritexx_V; sprite-alignment-ltr: left; */
-moz-outline-style: none;
+ outline: none;
}
.Main_LeftTabsBar_ButtonRight_selected {
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits