Skip to content

Commit

Permalink
js: Migrate code to not use deprecated 3.x features
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jan 28, 2024
1 parent c6d7d45 commit 6796741
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions js/ddox.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function setupDdox()
{
$(".tree-view").children(".package").click(toggleTree);
$(".tree-view").children(".package").on("click", toggleTree);
$(".tree-view.collapsed").children("ul").hide();
$("#symbolSearch").attr("tabindex", "1000");

updateSearchBox();
$('#sitesearch').change(updateSearchBox);
$('#sitesearch').on("change", updateSearchBox);
}

function updateSearchBox()
Expand Down
10 changes: 5 additions & 5 deletions js/dlang.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.addClass('open');

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

Expand All @@ -44,7 +44,7 @@
return false;
});

$('html').click(function(e) {
$('html').on("click", function(e) {
var clicking_main_bar = $(e.target).parents("#top").length > 0;
if (clicking_main_bar) return;
if (open_main_item !== null) {
Expand All @@ -54,16 +54,16 @@
});
}

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

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

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

if (elem.is(':visible')) {
Expand Down
2 changes: 1 addition & 1 deletion js/listanchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function addVersionSelector() {
});
$("h1").after("<div class='version-changer-container fa-select'><select id='version-changer'>" + options.join("") + "</select></div>");
// attach event listener to select box -> change URL
$("#version-changer").change(function(){
$("#version-changer").on("change", function(){
var selected = parseInt($(this).find("option:selected").val());
var option = versions[selected];
if (!option.selected) {
Expand Down
8 changes: 4 additions & 4 deletions js/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ function setupTextarea(el, opts)
args.css('height', height(31));
hideAllWindows();
argsDiv.css('display', 'block');
args.focus();
args.trigger("focus");
});
}

Expand All @@ -374,7 +374,7 @@ function setupTextarea(el, opts)
stdin.css('height', height(31));
hideAllWindows();
stdinDiv.css('display', 'block');
stdin.focus();
stdin.trigger("focus").
});
}

Expand All @@ -384,7 +384,7 @@ function setupTextarea(el, opts)
hideAllWindows();
code.css('display', 'block');
editor.refresh();
editor.focus();
editor.trigger("focus");
});
resetBtn.click(function(){
resetBtn.css('display', 'none');
Expand Down Expand Up @@ -413,7 +413,7 @@ function setupTextarea(el, opts)
outputDiv.css('display', 'block');
outputTitle.text("Application output");
output.html("Running...");
output.focus();
output.trigger("focus");

var data = {
code: opts.transformOutput(editor.getValue(), opts.compile)
Expand Down

0 comments on commit 6796741

Please sign in to comment.