thomascube
2011-08-29 e639c5da21b8b60be8b1771b80ac0557f88cb03f
Initialize GUI objects which are added after init

1 files modified
43 ■■■■■ changed files
program/js/app.js 43 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -86,12 +86,15 @@
    if (over) button_prop.over = over;
    this.buttons[command].push(button_prop);
    if (this.loaded)
      init_button(command, button_prop);
  };
  // register a specific gui object
  this.gui_object = function(name, id)
  {
    this.gui_objects[name] = id;
    this.gui_objects[name] = this.loaded ? rcube_find_object(id) : id;
  };
  // register a container object
@@ -4916,25 +4919,11 @@
  /*********           GUI functionality           *********/
  /*********************************************************/
  // enable/disable buttons for page shifting
  this.set_page_buttons = function()
  var init_button = function(cmd, prop)
  {
    this.enable_command('nextpage', 'lastpage', (this.env.pagecount > this.env.current_page));
    this.enable_command('previouspage', 'firstpage', (this.env.current_page > 1));
  };
  // set event handlers on registered buttons
  this.init_buttons = function()
  {
    for (var cmd in this.buttons) {
      if (typeof cmd !== 'string')
        continue;
      for (var i=0; i< this.buttons[cmd].length; i++) {
        var prop = this.buttons[cmd][i];
        var elm = document.getElementById(prop.id);
        if (!elm)
          continue;
      return;
        var preload = false;
        if (prop.type == 'image') {
@@ -4956,6 +4945,24 @@
          if (preload)
            new Image().src = prop.over;
        }
  };
  // enable/disable buttons for page shifting
  this.set_page_buttons = function()
  {
    this.enable_command('nextpage', 'lastpage', (this.env.pagecount > this.env.current_page));
    this.enable_command('previouspage', 'firstpage', (this.env.current_page > 1));
  };
  // set event handlers on registered buttons
  this.init_buttons = function()
  {
    for (var cmd in this.buttons) {
      if (typeof cmd !== 'string')
        continue;
      for (var i=0; i< this.buttons[cmd].length; i++) {
        init_button(cmd, this.buttons[cmd][i]);
      }
    }
  };
@@ -5568,7 +5575,7 @@
    var base = this.env.comm_path;
    // overwrite task name
    if (query._action.match(/([a-z]+)\/([a-z-_]+)/)) {
    if (query._action.match(/([a-z]+)\/([a-z-_.]+)/)) {
      query._action = RegExp.$2;
      base = base.replace(/\_task=[a-z]+/, '_task='+RegExp.$1);
    }