mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Correction scripts wre not adapted in Orchard following jquery changes
--HG-- branch : 1.x
This commit is contained in:
@@ -113,13 +113,13 @@
|
||||
_this.val(_this.attr("placeholder")).addClass("placeholderd");
|
||||
}
|
||||
})
|
||||
.live("focus", function () {
|
||||
.on("focus", function () {
|
||||
var _this = $(this);
|
||||
if (_this.val() === _this.attr("placeholder")) {
|
||||
_this.val("").removeClass("placeholderd");
|
||||
}
|
||||
})
|
||||
.live("blur", function () {
|
||||
.on("blur", function () {
|
||||
var _this = $(this);
|
||||
if (_this.val() === "") {
|
||||
_this.val(_this.attr("placeholder")).addClass("placeholderd");
|
||||
@@ -127,7 +127,7 @@
|
||||
});
|
||||
|
||||
//make sure the placeholder value is not taken as the input value when submitting forms
|
||||
$("form").live("submit", function () {
|
||||
$("form").on("submit", function () {
|
||||
$(":input[placeholder].placeholderd").val("");
|
||||
});
|
||||
|
||||
|
@@ -93,7 +93,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#content-picker-@Html.FieldIdFor(m => m.Field.Ids) .content-picker-remove').live("click", function() {
|
||||
$(document).on("click",'#content-picker-@Html.FieldIdFor(m => m.Field.Ids) .content-picker-remove',function() {
|
||||
$(this).closest('tr').remove();
|
||||
refreshIds();
|
||||
$('#save-message-@Html.FieldIdFor(m => m.Field.Ids)').show();
|
||||
|
@@ -10,12 +10,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
$("#img-cancel, #lib-cancel").live("click", function () { window.close(); });
|
||||
$(document).on("click", "#img-cancel, #lib-cancel", function () { window.close(); });
|
||||
// when url changes, set the preview and loader src
|
||||
$("#img-src").live("change", function () {
|
||||
$(document).on("change", "#img-src", function () {
|
||||
selectImage(getIdPrefix(this), this.value);
|
||||
});
|
||||
$(".media-item").live("click", function () {
|
||||
$(document).on("click", ".media-item", function () {
|
||||
if (selectedItem) {
|
||||
selectedItem.removeClass("selected");
|
||||
}
|
||||
@@ -24,15 +24,15 @@
|
||||
selectImage("#lib-", selectedItem.attr("data-imgsrc"));
|
||||
});
|
||||
// maintain aspect ratio when width or height is changed
|
||||
$("#img-width, #lib-width").live("change", fixAspectHeight);
|
||||
$("#img-height, #lib-height").live("change", fixAspectWidth);
|
||||
$(document).on("change", "#img-width, #lib-width", fixAspectHeight);
|
||||
$(document).on("change", "#img-height, #lib-height", fixAspectWidth);
|
||||
|
||||
$("#img-insert, #lib-insert").live("click", function () {
|
||||
$(document).on("click", "#img-insert, #lib-insert", function () {
|
||||
if ($(this).hasClass("disabled")) return;
|
||||
publishInsertEvent(this);
|
||||
});
|
||||
|
||||
$(".media-filename").live("click", function (ev) {
|
||||
$(document).on("click", ".media-filename", function (ev) {
|
||||
// when clicking on a filename in the gallery view,
|
||||
// we interrupt the normal operation and write a <img>
|
||||
// tag into a new window to ensure the image displays in
|
||||
@@ -44,7 +44,7 @@
|
||||
w.document.write("<!DOCTYPE html><html><head><title>" + src + "</title></head><body><img src=\"" + src + "\" alt=\"\" /></body></html>");
|
||||
});
|
||||
|
||||
$("#createFolder").live("click", function () {
|
||||
$(document).on("click", "#createFolder", function () {
|
||||
if ($(this).hasClass("disabled")) return;
|
||||
$.post("MediaPicker/CreateFolder", { path: query("mediaPath") || "", folderName: $("#folderName").val(), __RequestVerificationToken: $("#__requesttoken").val() },
|
||||
function (response) {
|
||||
@@ -59,7 +59,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$("#folderName").live("propertychange keyup input paste", function () {
|
||||
$(document).on("propertychange keyup input paste", "#folderName", function () {
|
||||
var empty = ($("#folderName").val() == "");
|
||||
$("#createFolder").attr("disabled", empty).toggleClass("disabled", empty);
|
||||
});
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
textBox.bind('keydown', function (event) {
|
||||
// don't navigate away from the field on tab when selecting an item
|
||||
if (event.keyCode === $.ui.keyCode.TAB && $(this).data('autocomplete').menu.active) {
|
||||
if (event.keyCode === $.ui.keyCode.TAB && $(this).data('ui-autocomplete').menu.active) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).autocomplete({
|
||||
|
@@ -39,13 +39,13 @@ jQuery(function ($) {
|
||||
return false;
|
||||
}
|
||||
}).each(function () {
|
||||
$(this).data('autocomplete')._renderItem = function (ul, item) {
|
||||
$(this).data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
var result = item.value == '' ? $('<li class="accategory"></li>') : $("<li></li>");
|
||||
|
||||
var desc = item.desc.length > 50 ? item.desc.substring(0, 50) + "..." : item.desc;
|
||||
|
||||
return result
|
||||
.data("item.autocomplete", item)
|
||||
.data("ui-autocomplete-item", item)
|
||||
.append('<a ><span class="aclabel">' + item.label + ' </span><span class="acvalue">' + item.value + ' </span><span class="acdesc">' + desc + "</span></a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
@@ -49,8 +49,7 @@
|
||||
|
||||
visContainer.append(layer);
|
||||
}
|
||||
|
||||
$("#widgets-layer-visibility .widgets-other-layer").live("click", function() {
|
||||
$(document).on("click", "#widgets-layer-visibility .widgets-other-layer", function() {
|
||||
var _this = $(this);
|
||||
_this.toggleClass("off");
|
||||
if (_this.hasClass("off")) {
|
||||
@@ -60,10 +59,10 @@
|
||||
_this.data("widgets").show();
|
||||
}
|
||||
});
|
||||
$("#widgets-layer-visibility .widgets-other-layer").live("hover", function() {
|
||||
$(document).on("hover", "#widgets-layer-visibility .widgets-other-layer", function() {
|
||||
$(this).data("widgets").toggleClass("on");
|
||||
});
|
||||
$("#widgets-zones .widgets-other-layer").live("hover", function() {
|
||||
$(document).on("hover", "#widgets-zones .widgets-other-layer", function() {
|
||||
var layer = $(this).data("widgets-vis-control");
|
||||
layer.toggleClass("on");
|
||||
layer.data("widgets").toggleClass("on");
|
||||
|
Reference in New Issue
Block a user