Commit 4a9e6f29 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "BUG 1651911: Remove functions depricated in jQuery 3.0"

parents 56746d04 dde201af
......@@ -152,18 +152,18 @@ jQuery(document).ready(function() {
window[prefix].callback(window[prefix].form, data);
});
j(document.body).bind('dragenter', function(ev) {
j(document.body).on('dragenter', function(ev) {
ev.stopPropagation();
ev.preventDefault();
});
j('#file_dropzone_container').bind('dragover', function(ev) {
j('#file_dropzone_container').on('dragover', function(ev) {
ev.stopPropagation();
ev.preventDefault();
ev.originalEvent.dataTransfer.dropEffect = 'copy';
j('#file_dropzone_container').addClass('dragover');
return false;
});
j('#file_dropzone_container').bind('dragleave', function(ev) {
j('#file_dropzone_container').on('dragleave', function(ev) {
ev.stopPropagation();
ev.preventDefault();
ev.originalEvent.dataTransfer.dropEffect = 'move';
......
......@@ -145,7 +145,7 @@ function FormChangeChecker(formid) {
this.bind = function() {
if (jQuery('form#' + self.id)) {
jQuery('form#' + self.id + ' :input').bind('change.changechecker', function() {
jQuery('form#' + self.id + ' :input').on('change.changechecker', function() {
// Only update the state if there are changes of any form input, EXCEPT for
// - search input
// - upload file input
......@@ -155,19 +155,19 @@ function FormChangeChecker(formid) {
}
self.state = FORM_CHANGED;
});
jQuery('form#' + self.id + ' :input[type="radio"]').bind('click.changechecker', function() {
jQuery('form#' + self.id + ' :input[type="radio"]').on('click.changechecker', function() {
self.state = FORM_CHANGED;
});
jQuery('form#' + self.id + ' :input.cancel').bind('click.changechecker', function() {
jQuery('form#' + self.id + ' :input.cancel').on('click.changechecker', function() {
self.reset();
});
jQuery('form#' + self.id + ' :input.submit').bind('click.changechecker', function() {
jQuery('form#' + self.id + ' :input.submit').on('click.changechecker', function() {
self.state = FORM_SUBMITTED;
});
jQuery('form#' + self.id + ' :input[type="file"]').bind('change.changechecker', function() {
jQuery('form#' + self.id + ' :input[type="file"]').on('change.changechecker', function() {
self.state = FORM_SUBMITTED;
});
jQuery('form#' + self.id).bind('submit.changechecker', function() {
jQuery('form#' + self.id).on('submit.changechecker', function() {
self.state = FORM_SUBMITTED;
});
}
......@@ -175,10 +175,10 @@ function FormChangeChecker(formid) {
this.unbind = function() {
if (jQuery('form#' + self.id)) {
jQuery('form#' + self.id + ' :input').unbind('change.changechecker');
jQuery('form#' + self.id + ' :input[type="radio"]').unbind('click.changechecker');
jQuery('form#' + self.id + ' :input.cancel').unbind('click.changechecker');
jQuery('form#' + self.id).unbind('submit.changechecker');
jQuery('form#' + self.id + ' :input').off('change.changechecker');
jQuery('form#' + self.id + ' :input[type="radio"]').off('click.changechecker');
jQuery('form#' + self.id + ' :input.cancel').off('click.changechecker');
jQuery('form#' + self.id).off('submit.changechecker');
}
}
......
......@@ -82,7 +82,7 @@ function pieform_element_authlist_js() {
return <<<EOF
// Since this menu is just a dummy selector, don't let it trigger the form change checker.
jQuery(document).on('pieform_postinit', function(event, form) {
jQuery('form[name=' + form.data.name + ']').find('select#dummySelect').unbind('change.changechecker');
jQuery('form[name=' + form.data.name + ']').find('select#dummySelect').off('change.changechecker');
});
EOF;
......@@ -91,4 +91,4 @@ EOF;
function pieform_element_authlist_get_headdata() {
$result = '<script type="application/javascript">' . pieform_element_authlist_js() . "</script>";
return array($result);
}
\ No newline at end of file
}
......@@ -286,12 +286,12 @@ function pieform_element_calendar_get_headdata($element) {
function add_prev_next_year(inst) {
var widgetHeader = jQuery("#ui-datepicker-div").find(".ui-datepicker-header");
var prevYrBtn = jQuery('<a class="ui-datepicker-prev-year ui-corner-all" title="$prev"><span class="ui-icon ui-icon-circle-triangle-wy" role="presentation" aria-hidden="true">$prev</span></a>');
prevYrBtn.unbind("click").bind("click", function() {
prevYrBtn.off("click").on("click", function() {
jQuery.datepicker._adjustDate(inst.input, -1, "Y");
}).hover(function() { \$j(this).addClass('ui-datepicker-prev-year-hover ui-state-hover')},
function() { \$j(this).removeClass('ui-datepicker-prev-year-hover ui-state-hover')});
var nextYrBtn = jQuery('<a class="ui-datepicker-next-year ui-corner-all" title="$next"><span class="ui-icon ui-icon-circle-triangle-ey" role="presentation" aria-hidden="true">$next</span></a>');
nextYrBtn.unbind("click").bind("click", function() {
nextYrBtn.off("click").on("click", function() {
jQuery.datepicker._adjustDate(inst.input, +1, "Y");
}).hover(function() { \$j(this).addClass('ui-datepicker-next-year-hover ui-state-hover')},
function() { \$j(this).removeClass('ui-datepicker-next-year-hover ui-state-hover')});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment