Bug Tracker

Modify

Ticket #1755 (closed bug: invalid)

Opened 6 years ago

Last modified 14 months ago

jQuery UI problem with drag and drop on Safari

Reported by: marklacas Owned by:
Priority: major Milestone: 1.2.2
Component: plugin Version: 1.2.1
Keywords: ui safari Cc:
Blocking: Blocked by:

Description

The code below works when I comment out or remove the activeClass and hoverClass options in droppable. When they are not commented out Safari doesn't do the drag (or drop) and spits out javascript errors in droppable.ext.js

$("#drop-box").addClass("droppable-active").droppable({

accept: ".activeClass", tolerance: "pointer", activeClass: "activecolor", hoverClass: "droppable-hover", drop: function( ev, ui ) {

$(this).append( $(document.createElement("div") ).text( $(ui.draggable.element).text() ));

}

});

$(".dragger").addClass("draggable").draggable({

helper: "clone"

});

Attachments

safari_reserved_word_1755.diff Download (562 bytes) - added by ebartels 5 years ago.
Fix use of reserved word in Safari2

Change History

comment:1 Changed 6 years ago by james_taylor

Seems to be a problem with how plugins are called (different errors happen depending on what plugins you are using), 'arguments' is a reserved word and Safari 2 doesn't let you rebind it as a local in the function (later WebKit builds don't seem to have a problem). The following fixes it for me:

Index: ui.mouse.js
===================================================================
--- ui.mouse.js (revision 3751)
+++ ui.mouse.js (working copy)
@@ -10,13 +10,13 @@
                                var a = $.ui[w].prototype; if(!a.plugins[c]) a.plugins[c] = [];
                                a.plugins[c].push([o,p]);
                        },
-                       call: function(instance, name, arguments) {
+                       call: function(instance, name, args) {
                                var c = instance.plugins[name]; if(!c) return;
                                var o = instance.interaction ? instance.interaction.options : instance.options;
                                var e = instance.interaction ? instance.interaction.element : instance.element;
 
                                for (var i = 0; i < c.length; i++) {
-                                       if (o[c[i][0]]) c[i][1].apply(e, arguments);
+                                       if (o[c[i][0]]) c[i][1].apply(e, args);
                                }
                        }
                }

comment:2 Changed 6 years ago by eric

I'll confirm. This fix works for me.

Changed 5 years ago by ebartels

Fix use of reserved word in Safari2

comment:3 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

If this bug is still present, please file a ticket on the UI tracker:

 http://ui.jquery.com/bugs/

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.