From f8679b86baca17de72fc361ba38251ec1005a97a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 16 Jan 2014 08:56:23 +0000 Subject: [PATCH] fix permanent reload on idots login screen caused by trying to show (on login page not existing) quick-add selectbox, now not loading idots javascript files at all for login page, as they are not needed --- .../idots/class.idots_framework.inc.php | 21 +++++++++++-------- phpgwapi/templates/idots/js/idots.js | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index 2b15de4154..bae64d5add 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -111,17 +111,20 @@ class idots_framework extends egw_framework egw_framework::set_onload('window.setTimeout(function(){window.scrollTo(0, 1);}, 100);'); } - // include regular include slidereffects.js - if (!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects']) + // load idots specific javascript files, if we are not in login or logout + if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('login', 'logout'))) { - self::validate_file('/phpgwapi/templates/idots/js/slidereffects.js'); + // include regular include slidereffects.js + if (!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects']) + { + self::validate_file('/phpgwapi/templates/idots/js/slidereffects.js'); + } + else + { + self::validate_file('/phpgwapi/templates/idots/js/simple_show_hide.js'); + } + self::validate_file('/phpgwapi/templates/idots/js/idots.js'); } - else - { - self::validate_file('/phpgwapi/templates/idots/js/simple_show_hide.js'); - } - self::validate_file('/phpgwapi/templates/idots/js/idots.js'); - if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover' && !html::$ua_mobile) { $show_menu_event = 'mouseover'; diff --git a/phpgwapi/templates/idots/js/idots.js b/phpgwapi/templates/idots/js/idots.js index 6775dadf08..bb0a0a9558 100644 --- a/phpgwapi/templates/idots/js/idots.js +++ b/phpgwapi/templates/idots/js/idots.js @@ -14,8 +14,9 @@ * idots javascript */ egw_LAB.wait(function() { - // add quick add select box - egw.link_quick_add('quick_add'); + // add quick-add select box, but only if parent is present (not for login page!) + var quick_add = document.getElementById('quick_add'); + if (quick_add) egw.link_quick_add(quick_add); // instanciate slideout menus via "data-slide-out" of egw.js script tag var egw_script = document.getElementById('egw_script_id');