[Prototype-core] Re: isLeftClick Bug in Proto 1.6.0 RC1
On 17/10/2007, Bart Lewis [EMAIL PROTECTED] wrote: Today I updated to Prototype 1.6.0 RC1 from RC0. I am also using Scriptaculous 1.8 preview. Beyond changing my contentloaded to dom:loaded the transition seemed to go fairly smoothly. Until I encountered the following error in IE (6 and 7): Drags created with new Draggable(...) no longer drag. I traced this back to prototype's isLeftClick always returning false. Looks like isLeftClick was significantly changed just yesterday: http://dev.rubyonrails.org/changeset/7926 -B Yes it was. Here is the new code you need for the is[Left|Middle|Right]Click to work. Around line 3700-ish. Event.Methods = (function() { var isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; isButton = function(event, code) { return event.button == buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { isButton = function(event, code) { switch (code) { case 0: return event.which == 1 !event.metaKey; case 1: return event.which == 1 event.metaKey; default: return false; } }; } else { isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } return { isLeftClick: function(event) { return isButton(event, 0) }, isMiddleClick: function(event) { return isButton(event, 1) }, isRightClick: function(event) { return isButton(event, 2) }, ... -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Prototype Pagination
Hey Mislav, Given that this is a forum dedicated to core improvements to prototype you're correct in that this isn't perfectly suited to the topic. On the other hand this forum is probably the biggest hub for prototype developers, and if not in mass than certainly in talent. Given that, this is exactly the audience I am attempting to attract. If the audience finds my monthly posts to be offensive I will cease such activity because that is not going to draw positive attention. The disclaimer aside, thanks for the response it is good to hear some feedback. Pagination in nature is typically server side which makes a lot of sense. For quite a few reasons though i have found client side pagination to be really useful. Creating a Google Gadget that displayed an RSS feed in pagination form was pretty fun and given the result set wasn't inordinately large it was a great implementation. It wouldn't be too hard to refactor code in the gadget to display anyone's RSS feed, if anyone is interested. I found the pagination control in that implementation to be a little smoother than scrolling, when you've got a small asset that scrolls inside a larger document that scrolls the UI can get tricky as the focus of the mouse determines which object will scroll with the mouse wheel. Cheers, Matt On Oct 17, 8:47 am, Mislav Marohnić [EMAIL PROTECTED] wrote: On 10/15/07, Matt Foster [EMAIL PROTECTED] wrote: I have developed a pretty smooth UI Control for handling client side pagination. It is composed of 3 classes that allow for maximum decoupling. In this manner the view is decoupled from the iteration control, such that the same iteration control can be used on any data set while the view can be specialized for any format of JSON or XML. I'm not sure if such announcements are suitable for this group. (Someone correct me if I'm wrong when stating it isn't.) That said: Interesting work. I handle pagination server-side myself (using the will_paginate plugin for Rails), but I definitely see use cases when you have to move this logic client-side. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---