Fixed issue 17870: Now 'Workspace' has, at most, one scrollbar
authorDavid Baz Fayos <david.baz@openbravo.com>
Thu, 24 Nov 2011 16:31:23 +0100
changeset 14373 82c2f4e4aefe
parent 14372 77352f416244
child 14374 df9e03f9dfea
Fixed issue 17870: Now 'Workspace' has, at most, one scrollbar
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Thu Nov 24 16:04:52 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Thu Nov 24 16:31:23 2011 +0100
@@ -53,7 +53,21 @@
   if (!title || title.length < cutLength) {
     return title;
   }
-  return title.substring(0, cutLength) + (suffix || '...');
+  var newTitle = title.substring(0, cutLength);
+  // To remove ugly title ends
+  while (newTitle.length > 4 && (newTitle.lastIndexOf(' - ') === newTitle.length - 3 || newTitle.lastIndexOf(' -') === newTitle.length - 2 || newTitle.lastIndexOf('  ') === newTitle.length - 2)) {
+    if (newTitle.lastIndexOf(' - ') === newTitle.length - 3) {
+      newTitle = newTitle.substring(0, newTitle.length - 2);
+    }
+    if (newTitle.lastIndexOf(' -') === newTitle.length - 2) {
+      newTitle = newTitle.substring(0, newTitle.length - 1);
+    }
+    if (newTitle.lastIndexOf('  ') === newTitle.length - 2) {
+      newTitle = newTitle.substring(0, newTitle.length - 1);
+    }
+  }
+  newTitle += suffix || '...';
+  return newTitle;
 };
 
 // ** {{{OB.Utilities.createDialog}}} **
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js	Thu Nov 24 16:04:52 2011 +0100
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js	Thu Nov 24 16:31:23 2011 +0100
@@ -212,9 +212,10 @@
     // the left layout containing the recent views and available widgets
     this.leftColumnLayout = isc.VStack.create({
       styleName: OB.Styles.OBMyOpenbravo.leftColumnLayout.styleName,
-      width: '15%',
-      height: 1,
-      overflow: 'visible',
+      width: 210,
+      height: '100%',
+      overflow: 'auto', // Changed from 'visible' to 'auto' due to issue https://issues.openbravo.com/view.php?id=17870
+      leaveScrollbarGap: true,
       members: [recentViewsLayout, recentDocumentsLayout, isc.LayoutSpacer.create({
         height: 5
       }), actionTitle, refreshLayout, addWidgetLayout]
@@ -236,14 +237,15 @@
     this.portalLayout = isc.PortalLayout.create({
       styleName: OB.Styles.OBMyOpenbravo.portalLayout.styleName,
       numColumns: 2,
-      width: '85%',
+      width: '*',
       showColumnMenus: false,
       canResizeColumns: false,
       canResizeRows: false,
       membersMargin: 10,
       columnBorder: 0,
-      overflow: 'visible', // Changed from 'auto' to 'visible' due to issue https://issues.openbravo.com/view.php?id=17870
+      overflow: 'auto',
       height: '100%',
+      leaveScrollbarGap: true,
       sendEvents: false,
 
       // the Column is an autochild of the PortalLayout with the
@@ -469,9 +471,9 @@
           recent.command = 'DEFAULT';
           
           lbl = isc.Label.create({
-            contents: OB.Utilities.truncTitle(recent.recentTitle, 20),
+            contents: OB.Utilities.truncTitle(recent.recentTitle, 18),
             recent: recent,
-            wrap: false,
+            wrap: true,
             width: '100%',
             showHover: true,
             showPrompt: true,