From fff23fcd8640554e64a19bc7dfd1a531eabff240 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 1 Sep 2009 02:07:01 +0000 Subject: [PATCH] navigation MDL-14632 Fixed minor regressions for recent patches * Search field now takes input again * Javascript event propogration is stopped to prevent refreshing when switch block position --- .../block_settings_navigation_tree.php | 3 +-- lib/javascript-navigation.js | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/blocks/settings_navigation_tree/block_settings_navigation_tree.php b/blocks/settings_navigation_tree/block_settings_navigation_tree.php index faabc0705c..e86c60ea8e 100644 --- a/blocks/settings_navigation_tree/block_settings_navigation_tree.php +++ b/blocks/settings_navigation_tree/block_settings_navigation_tree.php @@ -108,8 +108,7 @@ class block_settings_navigation_tree extends block_tree { $searchform->url = new moodle_url("$CFG->wwwroot/$CFG->admin/search.php"); $searchform->method = 'get'; $searchform->button->text = get_string('search'); - - $searchfield = html_field::make_text('query', optional_param('query', '', PARAM_RAW)); + $searchfield = html_field::make_text('query', optional_param('query', '', PARAM_RAW), '', 50); $searchfield->id = 'query'; $searchfield->style .= 'width: 7em;'; $searchfield->set_label(get_string('searchinsettings', 'admin'), 'query'); diff --git a/lib/javascript-navigation.js b/lib/javascript-navigation.js index df4f48069e..5611533fb4 100644 --- a/lib/javascript-navigation.js +++ b/lib/javascript-navigation.js @@ -292,6 +292,9 @@ navigation_tree.prototype.toggle_block_display = function(e) { * @return {bool} */ navigation_tree.prototype.move_to_sidebar_popout = function(e) { + + YAHOO.util.Event.stopEvent(e); + var element = document.getElementById(this.name).parentNode; if (element == null) { return false; @@ -357,6 +360,8 @@ navigation_tree.prototype.move_to_sidebar_popout = function(e) { */ navigation_tree.prototype.move_to_block_position = function(e) { + YAHOO.util.Event.stopEvent(e); + if (this.sideblockwidth !== null) { YAHOO.util.Dom.setStyle(sideblocknode, 'width', this.sideblockwidth); this.sideblockwidth = null; @@ -609,7 +614,6 @@ navigation_tab_panel.prototype.resize_tab = function () { YAHOO.util.Dom.setStyle(this.tabpanels[this.showntab.tabname].body, 'height', (screenheight-59)+'px'); YAHOO.util.Dom.addClass(this.tabpanels[this.showntab.tabname].body, 'oversized_content'); } - return true; } /** * This function sets everything up for the show even and then calls the panel's @@ -648,15 +652,14 @@ navigation_tab_panel.prototype.show_tab = function (e, tabname) { navigation_tab_panel.prototype.hide_tab = function(e, tabname) { if (this.preventhide===true) { this.preventhide = false; - return true; + } else { + this.showntab = null; + YAHOO.util.Event.addListener(tabname+'_sidebarpopup', "mouseover", this.show_tab, tabname, this); + YAHOO.util.Event.removeListener(window, 'resize', this.resize_tab); + YAHOO.util.Event.removeListener(document.body, "click", this.hide_tab); + YAHOO.util.Dom.removeClass(tabname+'_title', 'active_tab'); + this.tabpanels[tabname].hide(e, this.tabpanel); } - this.showntab = null; - YAHOO.util.Event.addListener(tabname+'_sidebarpopup', "mouseover", this.show_tab, tabname, this); - YAHOO.util.Event.removeListener(window, 'resize', this.resize_tab); - YAHOO.util.Event.removeListener(document.body, "click", this.hide_tab); - YAHOO.util.Dom.removeClass(tabname+'_title', 'active_tab'); - this.tabpanels[tabname].hide(e, this.tabpanel); - return true; } /** * This function removes a tab from the navigation tab panel -- 2.39.5