details: /erp/devel/pi/rev/2f62a7abe8fa
changeset: 7833:2f62a7abe8fa
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Fri Jul 09 17:50:42 2010 +0200
summary: Related to issue 13891: Added js changes to proper display of
classic windows in a MDI environment
diffstat:
src/org/openbravo/erpCommon/security/Login_F1.html | 2 +-
web/js/utils.js | 61 +++++++++++++++++++--
2 files changed, 55 insertions(+), 8 deletions(-)
diffs (121 lines):
diff -r b974f18346c6 -r 2f62a7abe8fa
src/org/openbravo/erpCommon/security/Login_F1.html
--- a/src/org/openbravo/erpCommon/security/Login_F1.html Fri Jul 09
16:52:17 2010 +0200
+++ b/src/org/openbravo/erpCommon/security/Login_F1.html Fri Jul 09
17:50:42 2010 +0200
@@ -90,7 +90,7 @@
clearForm();
} catch (e) {}
setWindowElementFocus('firstElement');
- if ((!revisionControl('7801')) || (isOpsInstance() !=
isOpsInstanceCached())) {
+ if ((!revisionControl('7833')) || (isOpsInstance() !=
isOpsInstanceCached())) {
alert(cacheMsg);
}
diff -r b974f18346c6 -r 2f62a7abe8fa web/js/utils.js
--- a/web/js/utils.js Fri Jul 09 16:52:17 2010 +0200
+++ b/web/js/utils.js Fri Jul 09 17:50:42 2010 +0200
@@ -22,6 +22,20 @@
* clear forms, pop up confirmation messages, submit the form, etc.
*/
+/**
+ * Code that will be executed once the file is parsed
+*/
+function utilsJSDirectExecution() {
+ isWindowInMDITab = checkWindowInMDITab();
+ isWindowInMDIContext = checkWindowInMDIContext();
+ if (isWindowInMDITab) {
+ adaptSkinToMDIEnvironment();
+ }
+}
+
+var isWindowInMDITab = false;
+var isWindowInMDIContext = false;
+var isMDIEnvironmentSet = false;
var baseFrameServlet = "../security/Login_FS.html";
var gColorSelected = "#c0c0c0";
@@ -74,7 +88,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 = '7801';
+ var number = '7833';
return number;
}
@@ -3125,6 +3139,43 @@
}
/**
+* Adds a style definition to Openbravo ERP main CSS
+* @param {String} selector
+* @param {declaration} declaration
+*/
+function addStyleRule (selector, declaration) {
+ var stylesheet;
+
+ for (var i=0; i < document.styleSheets.length; i++) {
+ if (document.styleSheets[i].href &&
+ document.styleSheets[i].href.indexOf("print")===-1 &&
+ document.styleSheets[i].href.indexOf("Openbravo_ERP")!==-1
+ ) {
+ stylesheet = document.styleSheets[i];
+ }
+ }
+
+ if (typeof stylesheet === "object") {
+ if (stylesheet.addRule) {
+ stylesheet.addRule(selector, declaration);
+ } else if (stylesheet.insertRule) {
+ stylesheet.insertRule(selector + ' { ' + declaration + ' }',
stylesheet.cssRules.length);
+ }
+ }
+}
+
+/**
+* Small changes in a 2.50 skin to proper view in a MDI tab
+*/
+function adaptSkinToMDIEnvironment() {
+ addStyleRule(".Main_NavBar_bg_left", "height: 1px;");
+ addStyleRule(".Main_NavBar_bg_right", "height: 1px;");
+ addStyleRule(".Main_ContentPane_LeftTabsBar", "display: none;");
+ addStyleRule(".Main_ContentPane_NavBar", "height: 0px;");
+ addStyleRule(".Main_ContentPane_NavBar#tdtopNavButtons", "display: none;");
+}
+
+/**
* Sets the class attribute of an element
* @param {String} id The ID of the element
* @param {String} selectClass The class to be setted.
@@ -5142,9 +5193,6 @@
* Start of functions to communicate with 3.0 tabbed interface
*/
-var isWindowInMDITab = false;
-var isWindowInMDIContext = false;
-
function LayoutMDICheck(target) {
if (target !== null) {
if (typeof target.OB !== "undefined") {
@@ -5158,14 +5206,11 @@
return false;
}
-var isMDIEnvironmentSet = false;
function setMDIEnvironment() {
if (isMDIEnvironmentSet) {
return;
}
isMDIEnvironmentSet = true;
- isWindowInMDITab = checkWindowInMDITab();
- isWindowInMDIContext = checkWindowInMDIContext();
if (isWindowInMDITab && typeof sendWindowInfoToMDI === "function") {
sendWindowInfoToMDI();
@@ -5564,3 +5609,5 @@
/**
* End of deprecated functions in 2.50
*/
+
+utilsJSDirectExecution();
\ No newline at end of file
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits