yufan shi
2005-Jul-06 04:54 UTC
[Rails-spinoffs] BUG? Draggable''s handle implementation does not match the documents
Hi, First thanks for your great scripts! According to the documents:http://script.aculo.us/drag-and-drop The Draggable''s option ''handle'' value is a string referencing a CSS class. The first child/grandchild/etc. element found within the element that has this CSS class will be used as the handle. However, in the source code file dragdrop.js line 250, is, this.handle= options.handle ? $(options.handle) : this.element; It seems to look for a element with id equals to the handle option''s value. I made some small changes, the code copied from Sortable // updated by lobster, 2005-07-06 // bug? according to the documents:http://script.aculo.us/drag-and-drop // The value is a string referencing a CSS class. The first child/grandchild/etc. // element found within the element that has this CSS class will be used as the handle. //this.handle = options.handle ? $(options.handle) : this.element; this.handle = options.handle ? Element.Class.childrenWith(this.element, options.handle)[0] : this.element; Now, the script works just like what was told by the document. -- Regards. Yufan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050706/76c44aa0/attachment.html
Thomas Fuchs
2005-Jul-06 04:58 UTC
[Rails-spinoffs] BUG? Draggable''s handle implementation does not match the documents
Thanks for the fix! When i get to clean up the code more, this will get in :) Thomas Am 06.07.2005 um 11:39 schrieb yufan shi:> Hi, > First thanks for your great scripts! > > According to the documents:http://script.aculo.us/drag-and-drop > The Draggable''s option ''handle'' value is a string referencing a > CSS class. The first child/grandchild/etc. > element found within the element that has this CSS class will be > used as the handle. > However, in the source code file dragdrop.js line 250, is, > this.handle= options.handle ? $(options.handle) : this.element; > > It seems to look for a element with id equals to the handle > option''s value. > > I made some small changes, the code copied from Sortable > // updated by lobster, 2005-07-06 > // bug? according to the documents:http://script.aculo.us/drag- > and-drop > // The value is a string referencing a CSS class. The first > child/grandchild/etc. > // element found within the element that has this CSS class > will be used as the handle. > //this.handle = options.handle ? $(options.handle) : > this.element; > this.handle = options.handle ? Element.Class.childrenWith > (this.element, options.handle)[0] : this.element; > Now, the script works just like what was told by the document. > > -- > Regards. > > Yufan > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050706/c9e2d7a3/attachment.html