Skip to content

Commit

Permalink
maint(cleanup): Replace deprecated API calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Feb 14, 2023
1 parent 1e912a0 commit 14c36bc
Show file tree
Hide file tree
Showing 16 changed files with 125 additions and 125 deletions.
2 changes: 1 addition & 1 deletion src/pat/autotoc/autotoc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ describe("AutoTOC", function () {
// expect(documentOffset).toEqual(headingOffset);
// done();
// })
// .click();
// .trigger("click");
// });
});
2 changes: 1 addition & 1 deletion src/pat/controlpanels/contentrules--implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class Contentrules {
self.updatezebra($table);
});

$("#rules_disable_globally").change(function () {
$("#rules_disable_globally").on("change", function () {
var form = $("#fieldset-global form");
var disabled = "";
if ($("#rules_disable_globally")[0].checked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class DexterityTypesListing {
import("./schemaeditor--implementation"); // register plone_schemaeditor_normalize_string method.

// Button Clone
$("#crud-edit-form-buttons-clone", this.el).click(function (e) {
$("#crud-edit-form-buttons-clone", this.el).on("click", function (e) {
var selected = $("input[id$=-widgets-select-0]:checked", this.el);
if (selected.length === 1) {
e.preventDefault();
Expand All @@ -24,12 +24,12 @@ export default class DexterityTypesListing {
displayInModal: false,
},
});
$el.click();
$el.trigger("click");
}
});

// Button delete
$("#crud-edit-form-buttons-delete", this.el).click(function (e) {
$("#crud-edit-form-buttons-delete", this.el).on("click", function (e) {
var items = 0,
msg;
$("td.count", this.el)
Expand Down
12 changes: 6 additions & 6 deletions src/pat/controlpanels/discussion-moderation--implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class Contentrules {
* Delete a single comment.
**********************************************************************/
// eslint-disable-next-line no-unused-vars
$("button[name='form.button.moderation.DeleteComment']").click(function (e) {
$("button[name='form.button.moderation.DeleteComment']").on("click", function (e) {
e.preventDefault();
var row = $(this).closest("tr");
var path = row.find("[name='selected_obj_paths:list']").attr("value");
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class Contentrules {
/**********************************************************************
* Transmit a single comment.
**********************************************************************/
$('button[name="form.button.moderation.TransmitComment"]').click(function (e) {
$('button[name="form.button.moderation.TransmitComment"]').on("click", function (e) {
e.preventDefault();
var row = $(this).closest("tr");
var path = $(row).find("[name='selected_obj_paths:list']").attr("value");
Expand Down Expand Up @@ -89,7 +89,7 @@ export default class Contentrules {
/**********************************************************************
* Bulk actions for comments (delete, publish)
**********************************************************************/
$("button[name='form.button.BulkAction']").click(function (e) {
$("button[name='form.button.BulkAction']").on("click", function (e) {
e.preventDefault();
var form = $(this).closest("form");
var target = $(form).attr("action");
Expand Down Expand Up @@ -126,7 +126,7 @@ export default class Contentrules {
/**********************************************************************
* Check or uncheck all checkboxes from the batch moderation page.
**********************************************************************/
$("input[name='check_all']").click(function () {
$("input[name='check_all']").on("click", function () {
if ($(this).val() === "0") {
$(this).parents("table").find("input:checkbox").prop("checked", true);
$(this).val("1");
Expand All @@ -140,7 +140,7 @@ export default class Contentrules {
* select comments with review_state
**********************************************************************/

$("input[name='review_state']").click(function () {
$("input[name='review_state']").on("click", function () {
let review_state = $(this).val();
let url = location.href;
if (location.search) {
Expand All @@ -165,7 +165,7 @@ export default class Contentrules {
/**********************************************************************
* Show full text of a comment in the batch moderation page.
**********************************************************************/
$(".show-full-comment-text").click(function (e) {
$(".show-full-comment-text").on("click", function (e) {
e.preventDefault();
var target = $(this).attr("href");
var parent = $(this).parent();
Expand Down
6 changes: 3 additions & 3 deletions src/pat/livesearch/livesearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default Base.extend({
_t("Previous") +
"</a>"
);
$prev.click(function (e) {
$prev.on("click", function (e) {
self.disableHiding = true;
e.preventDefault();
self.doSearch(self.page - 1);
Expand All @@ -186,7 +186,7 @@ export default Base.extend({
_t("Next") +
"</a>"
);
$next.click(function (e) {
$next.on("click", function (e) {
self.disableHiding = true;
e.preventDefault();
self.doSearch(self.page + 1);
Expand Down Expand Up @@ -314,7 +314,7 @@ export default Base.extend({
self.render();
}
});
$("#sorting-options a").click(function (e) {
$("#sorting-options a").on("click", function (e) {
e.preventDefault();
self.onceFocused = false;
});
Expand Down
10 changes: 5 additions & 5 deletions src/pat/manageportlets/manageportlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default Base.extend({
parent case, bind the link so we can reload modal */
$(".portlets-link-to-parent")
.off("click")
.click(function (e) {
.on("click", function (e) {
that.loading.show();
var $el = $(this);
e.preventDefault();
Expand Down Expand Up @@ -148,14 +148,14 @@ export default Base.extend({
},
setupPortletEdit: function () {
var that = this;
$(".managedPortlet .portletHeader > a", that.$el).click(function (e) {
$(".managedPortlet .portletHeader > a", that.$el).on("click", function (e) {
e.preventDefault();
that.showEditPortlet($(this).attr("href"));
});
},
setupAddDropdown: function () {
var that = this;
$(".add-portlet", that.$el).change(function (e) {
$(".add-portlet", that.$el).on("change", function (e) {
e.preventDefault();
var $select = $(this);
var $form = $select.parents("form");
Expand Down Expand Up @@ -184,11 +184,11 @@ export default Base.extend({
},
});
// Block/unblock inherited portlets (parent, group and content type portlets)
$(".portlets-settings select", that.$el).change(function () {
$(".portlets-settings select", that.$el).on("change", function () {
log.info("select change");
clearTimeout(that.submitTimeout);
that.submitTimeout = window.setTimeout(function () {
$(".portlets-settings", that.$el).submit();
$(".portlets-settings", that.$el).trigger("submit");
}, 100);
});
},
Expand Down
52 changes: 26 additions & 26 deletions src/pat/modal/modal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.3 - position: right middle, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -270,7 +270,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.4 - position: center top, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -288,7 +288,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("30px");
done();
})
.click();
.trigger("click");
});
it("7.5 - position: center bottom, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -315,7 +315,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("30px");
done();
})
.click();
.trigger("click");
});
it("7.6 - position: left top, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -331,7 +331,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.7 - position: left bottom, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -356,7 +356,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.8 - position: right top, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -373,7 +373,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.9 - position: right bottom, margin: 0, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -399,7 +399,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});

//
Expand Down Expand Up @@ -431,7 +431,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("25px");
done();
})
.click();
.trigger("click");
});
it("7.11 - position: left middle, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -457,7 +457,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("5px");
done();
})
.click();
.trigger("click");
});
it("7.12 - position: right middle, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -484,7 +484,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.13 - position: center top, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -502,7 +502,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("25px");
done();
})
.click();
.trigger("click");
});
it("7.14 - position: center bottom, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -529,7 +529,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("25px");
done();
})
.click();
.trigger("click");
});
it("7.15 - position: left top, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -545,7 +545,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("5px");
done();
})
.click();
.trigger("click");
});
it("7.16 - position: left bottom, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -570,7 +570,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("5px");
done();
})
.click();
.trigger("click");
});
it("7.17 - position: right top, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -587,7 +587,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.18 - position: right bottom, margin: 5, modal: 340x280, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -613,7 +613,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});

//
Expand Down Expand Up @@ -641,7 +641,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.20 - position: left middle, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -665,7 +665,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.21 - position: right middle, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -690,7 +690,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.22 - position: center top, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -706,7 +706,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.23 - position: center bottom, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -731,7 +731,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.24 - position: left top, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -747,7 +747,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.25 - position: left bottom, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -772,7 +772,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("0px");
done();
})
.click();
.trigger("click");
});
it("7.26 - position: right top, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -789,7 +789,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
it("7.27 - position: right bottom, margin: 0, modal: 450x350, wrapper: 400x300", function (done) {
$("#body2 a.pat-plone-modal")
Expand All @@ -815,7 +815,7 @@ describe("Modal", function () {
expect(pos.left).toEqual("auto");
done();
})
.click();
.trigger("click");
});
});
});
Loading

0 comments on commit 14c36bc

Please sign in to comment.