Move sidebar width generation to DimpBase.js.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 07:56:12 +0000 (01:56 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 22:16:28 +0000 (16:16 -0600)
imp/js/DimpBase.js
imp/templates/index/index-dimp.inc
imp/templates/javascript_defs_dimp.php
imp/themes/screen-dimp.css

index e653ce8..0336777 100644 (file)
@@ -2557,6 +2557,11 @@ var DimpBase = {
         /* Limit to msgList only. */
         $('msgList').observe('dblclick', this.dblclickHandler.bindAsEventListener(this));
 
+        /* Set sidebar width. */
+        $('sidebarPanel').setStyle({ width: DIMP.conf.sidebar_width });
+        $('dimpmain').setStyle({ left: DIMP.conf.sidebar_width });
+
+        /* Show page now. */
         $('dimpLoading').hide();
         $('dimpPage').show();
 
index a02bb47..2d6ca47 100644 (file)
@@ -10,9 +10,6 @@ $loading_text = _("Loading...");
 $has_blacklist = $registry->hasMethod('mail/blacklistFrom');
 $has_whitelist = $registry->hasMethod('mail/whitelistFrom');
 
-// Sidebar width
-$sidebar_width = max((int)$prefs->getValue('sidebar_width') - 50, 150) . 'px';
-
 // Quota information
 $show_quota = (isset($_SESSION['imp']['quota']) && is_array($_SESSION['imp']['quota']));
 
@@ -56,7 +53,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
 <div id="dimpPage" style="display:none">
  <div id="header"></div>
  <div id="pageContainer">
-  <div id="sidebarPanel" class="noprint" style="width:<?php echo $sidebar_width ?>">
+  <div id="sidebarPanel" class="noprint">
    <div id="logo"><h1><a id="logolink"><?php echo _("Horde") ?></a></h1></div>
    <ul id="dimpbarActions">
     <?php echo _simpleButton('composelink', _("_New Message"), 'compose.png') ?>
@@ -66,7 +63,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
     <?php echo _simpleButton('applyfilterlink', _("Apply Filter"), 'filters.png') ?>
 <?php endif; ?>
    </ul>
-   <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+   <div class="sepfull"></div>
    <ul id="serviceActions">
 <?php if ($registry->get('status', 'horde') != 'hidden' && $registry->get('status', 'horde') != 'notoolbar'): ?>
     <?php echo _simpleButton('appportal', _("_Portal"), 'horde.png', $hordeimg) ?>
@@ -78,12 +75,12 @@ function _simpleButton($id, $text, $image, $imagedir = null)
     <?php echo _simpleButton('applogout', _("_Log Out"), 'logout.png', $hordeimg) ?>
 <?php endif; ?>
    </ul>
-   <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+   <div class="sepfull"></div>
    <div id="foldersLoading"><?php echo $loading_text ?></div>
    <div id="foldersSidebar" style="display:none">
     <ul class="folderlist" id="specialfolders"></ul>
 <?php if (!empty($application_folders)): ?>
-    <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+    <div class="sepfull"></div>
     <ul id="applicationfolders">
 <?php foreach ($application_folders as $val): ?>
      <li class="custom">
@@ -95,12 +92,12 @@ function _simpleButton($id, $text, $image, $imagedir = null)
 <?php endif; ?>
 <?php if (!empty($site_menu)): ?>
     <div id="sitemenu">
-     <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+     <div class="sepfull"></div>
      <ul>
 <?php foreach ($site_menu as $key => $menu_item): ?>
 <?php if ($menu_item == 'separator'): ?>
      </ul>
-     <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+     <div class="sepfull"></div>
      <ul>
 <?php else: ?>
       <li class="custom">
@@ -112,7 +109,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
      </ul>
     </div>
 <?php endif; ?>
-    <div class="sepfull" style="width:<?php echo $sidebar_width ?>"></div>
+    <div class="sepfull"></div>
     <div id="myfolders"><?php echo _("My Folders") ?></div>
     <ul class="folderlist" id="normalfolders">
      <li class="folder" id="folderopts">
@@ -127,7 +124,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
    </div>
   </div>
 
-  <div id="dimpmain" style="left:<?php echo $sidebar_width ?>">
+  <div id="dimpmain">
    <div id="dimpmain_portal"><?php echo $loading_text ?></div>
    <div id="dimpmain_folder" style="display:none">
     <div id="dimpmain_folder_top" class="noprint">
index 9cdce88..c005c86 100644 (file)
@@ -77,6 +77,7 @@ $code['conf'] = array_filter(array(
     'qsearchfield' => $GLOBALS['prefs']->getValue('dimp_qsearch_field'),
     'refresh_time' => intval($GLOBALS['prefs']->getValue('refresh_time')),
     'searchprefix' => IMP_Search::MBOX_PREFIX,
+    'sidebar_width' => max((int)$GLOBALS['prefs']->getValue('sidebar_width') - 50, 150) . 'px',
     'sortdate' => Horde_Imap_Client::SORT_DATE,
     'sortthread' => Horde_Imap_Client::SORT_THREAD,
     'spam_mbox' => IMP::folderPref($GLOBALS['prefs']->getValue('spam_folder'), true),
index 2d2d8fa..7b90153 100644 (file)
@@ -51,7 +51,6 @@ div#quota {
     top: 0;
     left: 0;
     padding: 7px 0 0 7px;
-    width: 150px;
     bottom: 0;
     z-index: 1;
     white-space: normal;
@@ -62,7 +61,6 @@ div#quota {
 #dimpmain {
     position: absolute;
     margin-left: 13px;
-    left: 150px;
     top: 4px;
     bottom: 0;
     right: 4px;
@@ -281,7 +279,6 @@ div.vpRow.flagDeleted {
     height: 1px !important;
     margin: 5px 0;
     overflow: hidden;
-    width: 150px;
     background: silver;
 }
 #sidebarPanel .count {