aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-06 14:13:03 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-06 14:13:03 +0200
commita051970d5b15a60e79ac2428280652486644c11c (patch)
tree5ba4bb540c12fa590055b23aee19f11d97cbed81 /p/scripts
parent5fa4f40133c78388ce3474f3d211707ea3c04ce6 (diff)
jQuery 3 compatibility
https://jquery.com/upgrade-guide/3.0/ * event.props removed https://jquery.com/upgrade-guide/3.0/#breaking-change-jquery-event-props-and-jquery-event-fixhooks-removed https://github.com/jquery/api.jquery.com/issues/405 * jqXHR.success(), jqXHR.error(), and jqXHR.complete() removed
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/category.js18
-rw-r--r--p/scripts/main.js2
2 files changed, 9 insertions, 11 deletions
diff --git a/p/scripts/category.js b/p/scripts/category.js
index c33e68528..8c7ba37b0 100644
--- a/p/scripts/category.js
+++ b/p/scripts/category.js
@@ -34,15 +34,13 @@ function init_draggable() {
return;
}
- $.event.props.push('dataTransfer');
-
var draggable = '[draggable="true"]',
dropzone = '[dropzone="move"]';
$('.drop-section').on('dragstart', draggable, function(e) {
- e.dataTransfer.effectAllowed = 'move';
- e.dataTransfer.setData('text/html', e.target.outerHTML);
- e.dataTransfer.setData('text', e.target.getAttribute('data-feed-id'));
+ e.originalEvent.dataTransfer.effectAllowed = 'move';
+ e.originalEvent.dataTransfer.setData('text/html', e.target.outerHTML);
+ e.originalEvent.dataTransfer.setData('text', e.target.getAttribute('data-feed-id'));
e.target.style.opacity = 0.3;
dnd_successful = false;
@@ -74,13 +72,13 @@ function init_draggable() {
$(this).removeClass('drag-hover');
});
$('.drop-section').on('dragover', dropzone, function(e) {
- e.dataTransfer.dropEffect = "move";
+ e.originalEvent.dataTransfer.dropEffect = "move";
e.preventDefault();
return false;
});
$('.drop-section').on('drop', dropzone, function(e) {
- var feed_id = e.dataTransfer.getData('text'),
+ var feed_id = e.originalEvent.dataTransfer.getData('text'),
cat_id = e.target.parentNode.getAttribute('data-cat-id');
loading = true;
@@ -92,13 +90,13 @@ function init_draggable() {
f_id: feed_id,
c_id: cat_id
}
- }).success(function() {
- $(e.target).after(e.dataTransfer.getData('text/html'));
+ }).done(function() {
+ $(e.target).after(e.originalEvent.dataTransfer.getData('text/html'));
if ($(e.target).hasClass('disabled')) {
$(e.target).remove();
}
dnd_successful = true;
- }).complete(function() {
+ }).always(function() {
loading = false;
});
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 01c8c9cf5..c95df54fa 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -772,7 +772,7 @@ function updateFeed(feeds, feeds_count) {
$.ajax({
type: 'POST',
url: feed['url'],
- }).complete(function (data) {
+ }).always(function (data) {
feed_processed++;
$("#actualizeProgress .progress").html(feed_processed + " / " + feeds_count);
$("#actualizeProgress .title").html(feed['title']);