From 1224a20b1120b7a3fee95797020c3cafa8c83a8d Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 30 Jan 2019 15:32:34 -0600 Subject: [PATCH] jQuery: Fix js requiring jQuery < 3.0 compatibility --- js/filedrop.field.js | 2 -- js/redactor-osticket.js | 4 ++++ scp/js/jquery.dropdown.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/filedrop.field.js b/js/filedrop.field.js index b0bc57f15..42b94e70f 100644 --- a/js/filedrop.field.js +++ b/js/filedrop.field.js @@ -292,8 +292,6 @@ */ ;(function($) { - jQuery.event.props.push("dataTransfer"); - var default_opts = { fallback_id: '', link: false, diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index 65491ea10..90db4d3ad 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -394,3 +394,7 @@ $(document).ajaxError(function(event, request, settings) { __('Refresh the current page to restore and continue your draft.')); } }); + +// .size() is deprecated as of jQuery 1.8 and should move to .length, but +// the packed Redactor code uses the deprecated function +$.fn.size = function() { return this.length; } diff --git a/scp/js/jquery.dropdown.js b/scp/js/jquery.dropdown.js index 84a843dfd..aba3947ad 100644 --- a/scp/js/jquery.dropdown.js +++ b/scp/js/jquery.dropdown.js @@ -63,7 +63,7 @@ if(jQuery) (function($) { function hideDropdowns(event) { - var targetGroup = event ? $(event.target).parents().andSelf() : null; + var targetGroup = event ? $(event.target).parents().addBack() : null; if( targetGroup && targetGroup.is('.action-dropdown') && !targetGroup.is('a') ) return; $('body') -- GitLab