Skip to content

Commit 6796741

Browse files
committed
js: Migrate code to not use deprecated 3.x features
1 parent c6d7d45 commit 6796741

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

js/ddox.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function setupDdox()
22
{
3-
$(".tree-view").children(".package").click(toggleTree);
3+
$(".tree-view").children(".package").on("click", toggleTree);
44
$(".tree-view.collapsed").children("ul").hide();
55
$("#symbolSearch").attr("tabindex", "1000");
66

77
updateSearchBox();
8-
$('#sitesearch').change(updateSearchBox);
8+
$('#sitesearch').on("change", updateSearchBox);
99
}
1010

1111
function updateSearchBox()

js/dlang.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.addClass('open');
2626

2727
var open_main_item = null;
28-
$('.expand-toggle').click(function(e) {
28+
$('.expand-toggle').on("click", function(e) {
2929
var container = $(this).parent('.expand-container');
3030
container.toggleClass('open');
3131

@@ -44,7 +44,7 @@
4444
return false;
4545
});
4646

47-
$('html').click(function(e) {
47+
$('html').on("click", function(e) {
4848
var clicking_main_bar = $(e.target).parents("#top").length > 0;
4949
if (clicking_main_bar) return;
5050
if (open_main_item !== null) {
@@ -54,16 +54,16 @@
5454
});
5555
}
5656

57-
$('.search-container .expand-toggle').click(function() {
58-
$('#search-query input').focus();
57+
$('.search-container .expand-toggle').on("click", function() {
58+
$('#search-query input').trigger("focus");
5959
});
6060

6161
// Insert the show/hide button if the contents section exists
6262
$('.page-contents-header').append('<span><a href="javascript:void(0);">[hide]</a></span>');
6363

6464
// Event to hide or show the "contents" section when the hide button
6565
// is clicked
66-
$(".page-contents-header a").click(function () {
66+
$(".page-contents-header a").on("click", function () {
6767
var elem = $('.page-contents > ol');
6868

6969
if (elem.is(':visible')) {

js/listanchors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function addVersionSelector() {
110110
});
111111
$("h1").after("<div class='version-changer-container fa-select'><select id='version-changer'>" + options.join("") + "</select></div>");
112112
// attach event listener to select box -> change URL
113-
$("#version-changer").change(function(){
113+
$("#version-changer").on("change", function(){
114114
var selected = parseInt($(this).find("option:selected").val());
115115
var option = versions[selected];
116116
if (!option.selected) {

js/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ function setupTextarea(el, opts)
364364
args.css('height', height(31));
365365
hideAllWindows();
366366
argsDiv.css('display', 'block');
367-
args.focus();
367+
args.trigger("focus");
368368
});
369369
}
370370

@@ -374,7 +374,7 @@ function setupTextarea(el, opts)
374374
stdin.css('height', height(31));
375375
hideAllWindows();
376376
stdinDiv.css('display', 'block');
377-
stdin.focus();
377+
stdin.trigger("focus").
378378
});
379379
}
380380

@@ -384,7 +384,7 @@ function setupTextarea(el, opts)
384384
hideAllWindows();
385385
code.css('display', 'block');
386386
editor.refresh();
387-
editor.focus();
387+
editor.trigger("focus");
388388
});
389389
resetBtn.click(function(){
390390
resetBtn.css('display', 'none');
@@ -413,7 +413,7 @@ function setupTextarea(el, opts)
413413
outputDiv.css('display', 'block');
414414
outputTitle.text("Application output");
415415
output.html("Running...");
416-
output.focus();
416+
output.trigger("focus");
417417

418418
var data = {
419419
code: opts.transformOutput(editor.getValue(), opts.compile)

0 commit comments

Comments
 (0)