]> git.mjollnir.org Git - moodle.git/commitdiff
navigation MDL-14632 Fixed minor regressions for recent patches
authorsamhemelryk <samhemelryk>
Tue, 1 Sep 2009 02:07:01 +0000 (02:07 +0000)
committersamhemelryk <samhemelryk>
Tue, 1 Sep 2009 02:07:01 +0000 (02:07 +0000)
 * Search field now takes input again
 * Javascript event propogration is stopped to prevent refreshing when switch block position

blocks/settings_navigation_tree/block_settings_navigation_tree.php
lib/javascript-navigation.js

index faabc0705c733c7fcaaf05db410ac3847042af09..e86c60ea8eb6548f576aa81ee59fbe4425246c9b 100644 (file)
@@ -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');
index df4f48069e3bc7af7530829c97fb823ea5eef0d3..5611533fb4f17c43473d8e1262c2cab0e5683f4a 100644 (file)
@@ -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