alecpl
2010-10-05 c288f9969e113cb7dbd38bf05167cc8e94e007ff
- Improve r4038: we can use keypress on FF and Opera, here we've got repetition
- Small code cleanup


2 files modified
15 ■■■■■ changed files
program/js/app.js 2 ●●● patch | view | raw | blame | history
program/js/editor.js 13 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -2768,7 +2768,7 @@
  this.init_address_input_events = function(obj)
  {
    obj.keydown(function(e){ return ref.ksearch_keydown(e, this); })
    obj[bw.ie || bw.safari || bw.chrome ? 'keydown' : 'keypress'](function(e){ return ref.ksearch_keydown(e, this); })
      .attr('autocomplete', 'off');
  };
program/js/editor.js
@@ -64,15 +64,18 @@
// react to real individual tinyMCE editor init
function rcmail_editor_callback()
{
  var elem = rcube_find_object('_from');
  if (elem && elem.type=='select-one') {
  var elem = rcube_find_object('_from'),
    fe = rcmail.env.compose_focus_elem;
  if (elem && elem.type == 'select-one') {
    rcmail.change_identity(elem);
    // Focus previously focused element
    if (rcmail.env.compose_focus_elem && rcmail.env.compose_focus_elem.id != rcmail.env.composebody)
      rcmail.env.compose_focus_elem.focus();
    if (fe && fe.id != rcmail.env.composebody)
      fe.focus();
  }
  // set tabIndex and set focus to element that was focused before
  rcmail_editor_tabindex(rcmail.env.compose_focus_elem && rcmail.env.compose_focus_elem.id == rcmail.env.composebody);
  rcmail_editor_tabindex(fe && fe.id == rcmail.env.composebody);
  // Trigger resize (needed for proper editor resizing in some browsers using default skin)
  $(window).resize();
}