Skip to content

Commit

Permalink
navigation MDL-14632 Fixed minor regressions for recent patches
Browse files Browse the repository at this point in the history
 * Search field now takes input again
 * Javascript event propogration is stopped to prevent refreshing when switch block position
  • Loading branch information
samhemelryk committed Sep 1, 2009
1 parent 50476da commit fff23fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ function get_content() {
$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');
Expand Down
21 changes: 12 additions & 9 deletions lib/javascript-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fff23fc

Please sign in to comment.