Handle UnsafeUrl and RemoveUrl clicks now and always for any future elements.

This commit is contained in:
Sipke Schoorstra
2013-11-07 18:31:22 +01:00
parent 469c2c6107
commit 6fc0c2157c
2 changed files with 2 additions and 2 deletions

View File

@@ -223,7 +223,7 @@
$(function () {
var magicToken = $("input[name=__RequestVerificationToken]").first();
if (!magicToken) { return; } // no sense in continuing if form POSTS will fail
$("a[itemprop~=UnsafeUrl]").on("click", function() {
$("body").on("click", "a[itemprop~=UnsafeUrl]", function() {
var _this = $(this);
var hrefParts = _this.attr("href").split("?");
var form = $("<form action=\"" + hrefParts[0] + "\" method=\"POST\" />");

View File

@@ -62,7 +62,7 @@
$(this).closest("form").find(".apply-bulk-actions-auto:first").click();
});
$("[itemprop~='RemoveUrl']").click(function () {
$("body").on("click", "[itemprop~='RemoveUrl']", function () {
// don't show the confirm dialog if the link is also UnsafeUrl, as it will already be handled in base.js
if ($(this).filter("[itemprop~='UnsafeUrl']").length == 1) {
return false;