Skip to content

Commit 0d659d4

Browse files
committed
Menu: Rename activate to focus and deactivate to blur method
1 parent d7682da commit 0d659d4

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

demos/menu/contextmenu.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
menu.hide();
3333
return false;
3434
}
35-
menu.menu("deactivate").show().css({top:0, left:0}).position({
35+
menu.menu("blur").show().position({
3636
my: "left top",
3737
at: "right top",
3838
of: this

tests/visual/menu/contextmenu.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}).click(function(event) {
3131
// TODO required to prevent the click handler below from handling this event
3232
event.stopPropagation();
33-
var menu = $("#menu" + this.id).menu("deactivate").show().position({
33+
var menu = $("#menu" + this.id).menu("blur").show().position({
3434
my: "left top",
3535
at: "right top",
3636
of: event.pageX > 0 ? event : this
@@ -72,7 +72,7 @@
7272
});
7373
}
7474
if (match.length) {
75-
menu.activate(event, match);
75+
menu.focus(event, match);
7676
if (match.length > 1) {
7777
menu.previousFilter = character;
7878
menu.filterTimer = setTimeout(function() {

tests/visual/menu/drilldown.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
var nested = this.activeItem.find(">ul");
109109
if (nested.length) {
110110
this._open(nested);
111-
nested.menu("activate", event, nested.children(":first"))
111+
nested.menu("focus", event, nested.children(":first"))
112112
}
113113
},
114114

@@ -185,7 +185,7 @@
185185
});
186186
}
187187
if (match.length) {
188-
menu.activate(event, match);
188+
menu.focus(event, match);
189189
if (match.length > 1) {
190190
menu.previousFilter = character;
191191
menu.filterTimer = setTimeout(function() {

tests/visual/menu/flyoutmenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ $.widget("ui.flyoutmenu", {
135135
activate: function(event, item) {
136136
if (item) {
137137
item.parent().data("menu").widget().show();
138-
item.parent().data("menu").activate(event, item);
138+
item.parent().data("menu").focus(event, item);
139139
}
140140
this.activeItem = item;
141141
this.active = item.parent("ul")
@@ -147,7 +147,7 @@ $.widget("ui.flyoutmenu", {
147147
},
148148
hide: function() {
149149
this.activeItem = this.element.children("li").first();
150-
this.element.find("ul").andSelf().menu("deactivate").hide();
150+
this.element.find("ul").andSelf().menu("blur").hide();
151151
}
152152
});
153153

ui/jquery.ui.menu.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $.widget("ui.menu", {
4343
}
4444
var target = $( event.target ).closest( ".ui-menu-item" );
4545
if ( target.length && target.parent()[0] === self.element[0] ) {
46-
self.activate( event, target );
46+
self.focus( event, target );
4747
}
4848
})
4949
.bind("mouseout.menu", function( event ) {
@@ -52,7 +52,7 @@ $.widget("ui.menu", {
5252
}
5353
var target = $( event.target ).closest( ".ui-menu-item" );
5454
if ( target.length && target.parent()[0] === self.element[0] ) {
55-
self.deactivate( event );
55+
self.blur( event );
5656
}
5757
});
5858
this.refresh();
@@ -118,9 +118,9 @@ $.widget("ui.menu", {
118118
.attr( "tabIndex", -1 );
119119
},
120120

121-
activate: function( event, item ) {
121+
focus: function( event, item ) {
122122
var self = this;
123-
this.deactivate();
123+
this.blur();
124124
if ( this._hasScroll() ) {
125125
var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0,
126126
paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
@@ -147,7 +147,7 @@ $.widget("ui.menu", {
147147
this._trigger( "focus", event, { item: item } );
148148
},
149149

150-
deactivate: function(event) {
150+
blur: function(event) {
151151
if (!this.active) {
152152
return;
153153
}
@@ -179,21 +179,21 @@ $.widget("ui.menu", {
179179

180180
_move: function(direction, edge, filter, event) {
181181
if ( !this.active ) {
182-
this.activate( event, this.element.children(edge)[filter]() );
182+
this.focus( event, this.element.children(edge)[filter]() );
183183
return;
184184
}
185185
var next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 );
186186
if ( next.length ) {
187-
this.activate( event, next );
187+
this.focus( event, next );
188188
} else {
189-
this.activate( event, this.element.children(edge)[filter]() );
189+
this.focus( event, this.element.children(edge)[filter]() );
190190
}
191191
},
192192

193193
nextPage: function( event ) {
194194
if ( this._hasScroll() ) {
195195
if ( !this.active || this.last() ) {
196-
this.activate( event, this.element.children( ".ui-menu-item" ).first() );
196+
this.focus( event, this.element.children( ".ui-menu-item" ).first() );
197197
return;
198198
}
199199
var base = this.active.offset().top,
@@ -204,17 +204,17 @@ $.widget("ui.menu", {
204204
return $( this ).offset().top - base - height < 0;
205205
});
206206

207-
this.activate( event, result );
207+
this.focus( event, result );
208208
} else {
209-
this.activate( event, this.element.children( ".ui-menu-item" )
209+
this.focus( event, this.element.children( ".ui-menu-item" )
210210
[ !this.active || this.last() ? "first" : "last" ]() );
211211
}
212212
},
213213

214214
previousPage: function( event ) {
215215
if ( this._hasScroll() ) {
216216
if ( !this.active || this.first() ) {
217-
this.activate( event, this.element.children( ".ui-menu-item" ).last() );
217+
this.focus( event, this.element.children( ".ui-menu-item" ).last() );
218218
return;
219219
}
220220

@@ -226,9 +226,9 @@ $.widget("ui.menu", {
226226
return $(this).offset().top - base + height > 0;
227227
});
228228

229-
this.activate( event, result );
229+
this.focus( event, result );
230230
} else {
231-
this.activate( event, this.element.children( ".ui-menu-item" )
231+
this.focus( event, this.element.children( ".ui-menu-item" )
232232
[ !this.active || this.first() ? ":last" : ":first" ]() );
233233
}
234234
},

0 commit comments

Comments
 (0)