From bfdecb4a8e47113dc0328966cebfd2ef5ee75a68 Mon Sep 17 00:00:00 2001 From: alec Date: Wed, 12 Oct 2011 07:15:41 +0000 Subject: - Fixed "jumping" Filters tab git-svn-id: https://svn.roundcube.net/trunk@5332 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/managesieve.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 9d2be50c6..ff27486d9 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -63,12 +63,7 @@ class managesieve extends rcube_plugin $this->register_action('plugin.managesieve-save', array($this, 'managesieve_save')); if ($this->rc->task == 'settings') { - // load localization - $this->add_texts('localization/', array('filters','managefilters')); - - if (!strpos($this->rc->action, 'managesieve')) { - $this->include_script('managesieve.js'); - } + $this->init_ui(); } else if ($this->rc->task == 'mail') { // register message hook @@ -82,18 +77,30 @@ class managesieve extends rcube_plugin } /** - * Add UI elements to the 'mailbox view' and 'show message' UI. + * Initializes plugin's UI (localization, js script) */ - function mail_task_handler() + private function init_ui() { + if ($this->ui_initialized) + return; + // load localization - $this->add_texts('localization/'); + $this->add_texts('localization/', array('filters','managefilters')); + $this->include_script('managesieve.js'); + + $this->ui_initialized = true; + } + /** + * Add UI elements to the 'mailbox view' and 'show message' UI. + */ + function mail_task_handler() + { // use jQuery for popup window $this->require_plugin('jqueryui'); - // include main js script - $this->include_script('managesieve.js'); + // include js script and localization + $this->init_ui(); // include styles $skin = $this->rc->config->get('skin'); @@ -281,13 +288,7 @@ class managesieve extends rcube_plugin function managesieve_actions() { - // load localization - $this->add_texts('localization/', array('filters','managefilters')); - - // include main js script - if ($this->api->output->type == 'html') { - $this->include_script('managesieve.js'); - } + $this->init_ui(); $error = $this->managesieve_start(); -- cgit v1.2.3