camscape - for excellent IT solutions itkb.ro - IT knowledge base

configurare email :: roundcube patch for ie (internet explorer) to solve small cc and bcc fields in compose window

Catalin
Catalin T.
TitleRoundcube Patch for IE (Internet Explorer) to solve small CC and BCC fields in compose window
Tagsroundcube ie10 internet explorer compose window cc and bcc are very small
Desc.Roundcube Patch for IE (Internet Explorer) to solve small CC and BCC fields in compose window
CodeKBEM0011 v1.0
Date16 mai 2013
"roundcube ie10 internet explorer compose window cc and bcc are very small"

The Internet Explorer IE7, IE8, IE9, IE10 problem:

When composing a new message and trying to add CC or  BCC's to it the boxes are very small.

roundcube ie10 cc and bcc display problem

Problem was caused by Internet Explorer trying to interpret display:block css code from this line:

tr id="compose-cc" style="display: block;"

the display:block attribute is added by javascript when clicking on Add CC, Add BCC, Add Reply-To links (buttons);
initial style for CC, BCC is display:none;


The patch is to make javascript adding display:table-row attribute if detected browser is IE (Internet Explorer) Roundcube allready have this type of patch implemented for Opera Browser, so we need only to extendit. The job is done by editing function show_header_form from /skins/yourtheme-name[default]/functions.js

Original function
show_header_form: function(id)
{
  var row, s,
    link = document.getElementById(id + '-link');

  if ((s = this.next_sibling(link)))
    s.style.display = 'none';
  else if ((s = this.prev_sibling(link)))
    s.style.display = 'none';

  link.style.display = 'none';

  if ((row = document.getElementById('compose-' + id))) {
    var div = document.getElementById('compose-div'),
      headers_div = document.getElementById('compose-headers-div');
    row.style.display = (document.all && !window.opera) ? 'block' : 'table-row'; //allready included patch for Opera Browser
    div.style.top = (parseInt(headers_div.offsetHeight, 10) + 3) + 'px';
    this.resize_compose_body();
  }

  return false;
}

Patched function

show_header_form: function(id)
{
  var row, s,
    link = document.getElementById(id + '-link');

  if ((s = this.next_sibling(link)))
    s.style.display = 'none';
  else if ((s = this.prev_sibling(link)))
    s.style.display = 'none';

  link.style.display = 'none';

  if ((row = document.getElementById('compose-' + id))) {
    var div = document.getElementById('compose-div'),
      headers_div = document.getElementById('compose-headers-div');
	 var isIE = /*@cc_on!@*/!1; //added in patch ad used in line bellow
    row.style.display = (document.all && !window.opera && !isIE) ? 'block' : 'table-row'; // now Opera and Internet Explorer will add attribute table-row for CC, BCC, Reply-To elements
    div.style.top = (parseInt(headers_div.offsetHeight, 10) + 3) + 'px';
    this.resize_compose_body();
  }

  return false;
}