Skip to content

Commit 24f1ce9

Browse files
committed
Tooltip: Remove core event/alias and deprecated module dependencies
1 parent c25a541 commit 24f1ce9

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

demos/tooltip/forms.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
$( "<button>" )
3737
.text( "Show help" )
3838
.button()
39-
.click(function() {
39+
.on( "click", function() {
4040
tooltips.tooltip( "open" );
4141
})
4242
.insertAfter( "form" );

demos/tooltip/video-player.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
text: !!$( this ).attr( "title" )
7676
});
77-
button.not( ".menu" ).click(function() {
77+
button.not( ".menu" ).on( "click", function() {
7878
notify( button );
7979
});
8080
});
@@ -83,7 +83,7 @@
8383
});
8484

8585
$( "button.menu" )
86-
.click(function() {
86+
.on( "click", function() {
8787
$( document ).tooltip( "close", { currentTarget: this });
8888
var menu = $( this ).next().show().position({
8989
my: "left top",

tests/unit/tooltip/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,20 @@ asyncTest( "programmatic focus with async content", function() {
137137
}
138138
});
139139

140-
element.bind( "tooltipopen", function( event ) {
140+
element.on( "tooltipopen", function( event ) {
141141
deepEqual( event.originalEvent.type, "focusin" );
142142

143-
element.bind( "tooltipclose", function( event ) {
143+
element.on( "tooltipclose", function( event ) {
144144
deepEqual( event.originalEvent.type, "focusout" );
145145
start();
146146
});
147147

148148
setTimeout(function() {
149-
element.blur();
149+
element.trigger( "blur" );
150150
});
151151
});
152152

153-
element.focus();
153+
element.trigger( "focus" );
154154
});
155155

156156
asyncTest( "destroy during hide animation; only one close event", function() {
@@ -161,7 +161,7 @@ asyncTest( "destroy during hide animation; only one close event", function() {
161161
hide: true
162162
});
163163

164-
element.bind( "tooltipclose", function() {
164+
element.on( "tooltipclose", function() {
165165
ok( true, "tooltip closed" );
166166
});
167167

tests/unit/tooltip/events.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ test( "mouse events", function() {
2929
expect( 2 );
3030
var element = $( "#tooltipped1" ).tooltip();
3131

32-
element.bind( "tooltipopen", function( event ) {
32+
element.on( "tooltipopen", function( event ) {
3333
deepEqual( event.originalEvent.type, "mouseover" );
3434
});
3535
element.trigger( "mouseover" );
3636

37-
element.bind( "tooltipclose", function( event ) {
37+
element.on( "tooltipclose", function( event ) {
3838
deepEqual( event.originalEvent.type, "mouseleave" );
3939
});
4040
element.trigger( "focusout" );
@@ -45,12 +45,12 @@ test( "focus events", function() {
4545
expect( 2 );
4646
var element = $( "#tooltipped1" ).tooltip();
4747

48-
element.bind( "tooltipopen", function( event ) {
48+
element.on( "tooltipopen", function( event ) {
4949
deepEqual( event.originalEvent.type, "focusin" );
5050
});
5151
element.trigger( "focusin" );
5252

53-
element.bind( "tooltipclose", function( event ) {
53+
element.on( "tooltipclose", function( event ) {
5454
deepEqual( event.originalEvent.type, "focusout" );
5555
});
5656
element.trigger( "mouseleave" );

tests/unit/tooltip/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ test( "track and programmatic focus", function() {
208208
expect( 1 );
209209
$( "#qunit-fixture div input" ).tooltip({
210210
track: true
211-
}).focus();
211+
}).trigger( "focus" );
212212
equal( "inputtitle", $( ".ui-tooltip" ).text() );
213213
});
214214

tests/visual/tooltip/tooltip.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
show: {
101101
delay: 500
102102
}
103-
}).click(function() {
104-
$( "#focus-on-me" ).focus();
103+
}).on( "click", function() {
104+
$( "#focus-on-me" ).trigger( "focus" );
105105
});
106106
});
107107
</script>

0 commit comments

Comments
 (0)