]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Rename activate to focus and deactivate to blur method
authorjzaefferer <joern.zaefferer@gmail.com>
Thu, 24 Feb 2011 09:06:08 +0000 (10:06 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Thu, 24 Feb 2011 09:06:08 +0000 (10:06 +0100)
demos/menu/contextmenu.html
tests/visual/menu/contextmenu.html
tests/visual/menu/drilldown.html
tests/visual/menu/flyoutmenu.js
ui/jquery.ui.menu.js

index f54c50d56f683682eef74b5a6df66436f4ac3bbb..1fa4daaeb20ce26e8976250ae545b5c0a35cd21a 100644 (file)
@@ -32,7 +32,7 @@
                                menu.hide();
                                return false;
                        }
-                       menu.menu("deactivate").show().css({top:0, left:0}).position({
+                       menu.menu("blur").show().position({
                                my: "left top",
                                at: "right top",
                                of: this
index 68fdd5234bac1b7a1f71cff1ae3dfca6f83c320b..03e21fdc3ad51ed56fc098eecf0b6f1af65d2479 100644 (file)
@@ -30,7 +30,7 @@
                }).click(function(event) {
                        // TODO required to prevent the click handler below from handling this event
                        event.stopPropagation();
-                       var menu = $("#menu" + this.id).menu("deactivate").show().position({
+                       var menu = $("#menu" + this.id).menu("blur").show().position({
                                my: "left top",
                                at: "right top",
                                of: event.pageX > 0 ? event : this
@@ -72,7 +72,7 @@
                                        });
                                }
                                if (match.length) {
-                                       menu.activate(event, match);
+                                       menu.focus(event, match);
                                        if (match.length > 1) {
                                                menu.previousFilter = character;
                                                menu.filterTimer = setTimeout(function() {
index 65cdf1111b1ea30a89690474db7930496837a6d4..572c1765b1c85bf8b1831d594bf205bfca20729b 100644 (file)
                                var nested = this.activeItem.find(">ul");
                                if (nested.length) {
                                        this._open(nested);
-                                       nested.menu("activate", event, nested.children(":first"))
+                                       nested.menu("focus", event, nested.children(":first"))
                                }
                        },
                        
                                        });
                                }
                                if (match.length) {
-                                       menu.activate(event, match);
+                                       menu.focus(event, match);
                                        if (match.length > 1) {
                                                menu.previousFilter = character;
                                                menu.filterTimer = setTimeout(function() {
index bffecea7fcb4bfae1451e0cd5f00436819dc5b80..2599d105bb1eefbf6b7e88be5851b8d4f66f5264 100644 (file)
@@ -135,7 +135,7 @@ $.widget("ui.flyoutmenu", {
        activate: function(event, item) {
                if (item) {
                        item.parent().data("menu").widget().show();
-                       item.parent().data("menu").activate(event, item);
+                       item.parent().data("menu").focus(event, item);
                }
                this.activeItem = item;
                this.active = item.parent("ul")
@@ -147,7 +147,7 @@ $.widget("ui.flyoutmenu", {
        },
        hide: function() {
                this.activeItem = this.element.children("li").first();
-               this.element.find("ul").andSelf().menu("deactivate").hide();
+               this.element.find("ul").andSelf().menu("blur").hide();
        }
 });
 
index c6c557134d80483100421b4579426ad1a27ff8c4..579610405a9c55e6f6a9331729ce1b962e4e178e 100644 (file)
@@ -43,7 +43,7 @@ $.widget("ui.menu", {
                                }
                                var target = $( event.target ).closest( ".ui-menu-item" );
                                if ( target.length && target.parent()[0] === self.element[0] ) {
-                                       self.activate( event, target );
+                                       self.focus( event, target );
                                }
                        })
                        .bind("mouseout.menu", function( event ) {
@@ -52,7 +52,7 @@ $.widget("ui.menu", {
                                }
                                var target = $( event.target ).closest( ".ui-menu-item" );
                                if ( target.length && target.parent()[0] === self.element[0] ) {
-                                       self.deactivate( event );
+                                       self.blur( event );
                                }
                        });
                this.refresh();
@@ -118,9 +118,9 @@ $.widget("ui.menu", {
                        .attr( "tabIndex", -1 );
        },
 
-       activate: function( event, item ) {
+       focus: function( event, item ) {
                var self = this;
-               this.deactivate();
+               this.blur();
                if ( this._hasScroll() ) {
                        var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0,
                                paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
@@ -147,7 +147,7 @@ $.widget("ui.menu", {
                this._trigger( "focus", event, { item: item } );
        },
 
-       deactivate: function(event) {
+       blur: function(event) {
                if (!this.active) {
                        return;
                }
@@ -179,21 +179,21 @@ $.widget("ui.menu", {
 
        _move: function(direction, edge, filter, event) {
                if ( !this.active ) {
-                       this.activate( event, this.element.children(edge)[filter]() );
+                       this.focus( event, this.element.children(edge)[filter]() );
                        return;
                }
                var next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 );
                if ( next.length ) {
-                       this.activate( event, next );
+                       this.focus( event, next );
                } else {
-                       this.activate( event, this.element.children(edge)[filter]() );
+                       this.focus( event, this.element.children(edge)[filter]() );
                }
        },
        
        nextPage: function( event ) {
                if ( this._hasScroll() ) {
                        if ( !this.active || this.last() ) {
-                               this.activate( event, this.element.children( ".ui-menu-item" ).first() );
+                               this.focus( event, this.element.children( ".ui-menu-item" ).first() );
                                return;
                        }
                        var base = this.active.offset().top,
@@ -204,9 +204,9 @@ $.widget("ui.menu", {
                                return $( this ).offset().top - base - height < 0;
                        });
 
-                       this.activate( event, result );
+                       this.focus( event, result );
                } else {
-                       this.activate( event, this.element.children( ".ui-menu-item" )
+                       this.focus( event, this.element.children( ".ui-menu-item" )
                                [ !this.active || this.last() ? "first" : "last" ]() );
                }
        },
@@ -214,7 +214,7 @@ $.widget("ui.menu", {
        previousPage: function( event ) {
                if ( this._hasScroll() ) {
                        if ( !this.active || this.first() ) {
-                               this.activate( event, this.element.children( ".ui-menu-item" ).last() );
+                               this.focus( event, this.element.children( ".ui-menu-item" ).last() );
                                return;
                        }
 
@@ -226,9 +226,9 @@ $.widget("ui.menu", {
                                return $(this).offset().top - base + height > 0;
                        });
 
-                       this.activate( event, result );
+                       this.focus( event, result );
                } else {
-                       this.activate( event, this.element.children( ".ui-menu-item" )
+                       this.focus( event, this.element.children( ".ui-menu-item" )
                                [ !this.active || this.first() ? ":last" : ":first" ]() );
                }
        },