Replace uses of var with let or const as appropriate
This commit is contained in:
parent
f83424aeb2
commit
c47cb299a8
36 changed files with 427 additions and 430 deletions
|
@ -5,8 +5,8 @@
|
|||
* the user next switches to it.
|
||||
*/
|
||||
$(document).on("change", ".richtext_container textarea", function () {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
var preview = container.find(".tab-pane[id$='_preview']");
|
||||
const container = $(this).closest(".richtext_container");
|
||||
const preview = container.find(".tab-pane[id$='_preview']");
|
||||
|
||||
preview.children(".richtext_placeholder").attr("hidden", true).removeClass("delayed-fade-in");
|
||||
preview.children(".richtext").empty();
|
||||
|
@ -17,10 +17,10 @@
|
|||
* when switching away from an edit pane
|
||||
*/
|
||||
$(document).on("hide.bs.tab", ".richtext_container button[data-bs-target$='_edit']", function () {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
var editor = container.find("textarea");
|
||||
var preview = container.find(".tab-pane[id$='_preview']");
|
||||
var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height();
|
||||
const container = $(this).closest(".richtext_container");
|
||||
const editor = container.find("textarea");
|
||||
const preview = container.find(".tab-pane[id$='_preview']");
|
||||
const minHeight = editor.outerHeight() - preview.outerHeight() + preview.height();
|
||||
|
||||
preview.css("min-height", minHeight + "px");
|
||||
});
|
||||
|
@ -29,9 +29,9 @@
|
|||
* Install a handler to switch to preview mode
|
||||
*/
|
||||
$(document).on("show.bs.tab", ".richtext_container button[data-bs-target$='_preview']", function () {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
var editor = container.find("textarea");
|
||||
var preview = container.find(".tab-pane[id$='_preview']");
|
||||
const container = $(this).closest(".richtext_container");
|
||||
const editor = container.find("textarea");
|
||||
const preview = container.find(".tab-pane[id$='_preview']");
|
||||
|
||||
if (preview.children(".richtext").contents().length === 0) {
|
||||
preview.children(".richtext_placeholder").removeAttr("hidden").addClass("delayed-fade-in");
|
||||
|
@ -50,18 +50,18 @@
|
|||
});
|
||||
|
||||
function invalidTextareaListener() {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
const container = $(this).closest(".richtext_container");
|
||||
|
||||
container.find("button[data-bs-target$='_edit']").tab("show");
|
||||
}
|
||||
|
||||
function updateHelp() {
|
||||
$(".richtext_container .richtext_help_sidebar:not(:visible):not(:empty)").each(function () {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
const container = $(this).closest(".richtext_container");
|
||||
$(this).children().appendTo(container.find(".tab-pane[id$='_help']"));
|
||||
});
|
||||
$(".richtext_container .richtext_help_sidebar:visible:empty").each(function () {
|
||||
var container = $(this).closest(".richtext_container");
|
||||
const container = $(this).closest(".richtext_container");
|
||||
container.find(".tab-pane[id$='_help']").children().appendTo($(this));
|
||||
if (container.find("button[data-bs-target$='_help'].active").length) {
|
||||
container.find("button[data-bs-target$='_edit']").tab("show");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue