Changeset 5332 in subversion


Ignore:
Timestamp:
Oct 12, 2011 3:15:41 AM (20 months ago)
Author:
alec
Message:
  • Fixed "jumping" Filters tab
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/managesieve/managesieve.php

    r5300 r5332  
    6464 
    6565        if ($this->rc->task == 'settings') { 
    66             // load localization 
    67             $this->add_texts('localization/', array('filters','managefilters')); 
    68  
    69             if (!strpos($this->rc->action, 'managesieve')) { 
    70                 $this->include_script('managesieve.js'); 
    71             } 
     66            $this->init_ui(); 
    7267        } 
    7368        else if ($this->rc->task == 'mail') { 
     
    8075            } 
    8176        } 
     77    } 
     78 
     79    /** 
     80     * Initializes plugin's UI (localization, js script) 
     81     */ 
     82    private function init_ui() 
     83    { 
     84        if ($this->ui_initialized) 
     85            return; 
     86 
     87        // load localization 
     88        $this->add_texts('localization/', array('filters','managefilters')); 
     89        $this->include_script('managesieve.js'); 
     90 
     91        $this->ui_initialized = true; 
    8292    } 
    8393 
     
    8797    function mail_task_handler() 
    8898    { 
    89         // load localization 
    90         $this->add_texts('localization/'); 
    91  
    9299        // use jQuery for popup window 
    93100        $this->require_plugin('jqueryui');  
    94101 
    95         // include main js script 
    96         $this->include_script('managesieve.js'); 
     102        // include js script and localization 
     103        $this->init_ui(); 
    97104 
    98105        // include styles 
     
    282289    function managesieve_actions() 
    283290    { 
    284         // load localization 
    285         $this->add_texts('localization/', array('filters','managefilters')); 
    286  
    287         // include main js script 
    288         if ($this->api->output->type == 'html') { 
    289             $this->include_script('managesieve.js'); 
    290         } 
     291        $this->init_ui(); 
    291292 
    292293        $error = $this->managesieve_start(); 
Note: See TracChangeset for help on using the changeset viewer.