HI Martin. Are you sure that the direction is already part of the events
data?

According to the qooxdoo blog post, the event data looks like this:

{
    "offset": 0,
    "input": "10%",
    "index": 0,
    "element" : 0
}


My recommendation was to amend the waypoint event data to:

{
  "offset": 0,
  "input": "10%",
  "index": 0,
  "element" : 0,
  "direction" : "scrolldown"
}


Derrell


On Thu, Aug 28, 2014 at 2:14 AM, Martin Wittemann <martin.wittem...@1und1.de
> wrote:

>  Hello Derrel,
> thanks for your feedback. This is already possible because the direction
> is already part of the events data. Based on that, the developer could
> trigger a reload only on down scrolls.
> Regards,
> Martin
>
>  Am 15.08.2014 um 15:24 schrieb Derrell Lipman <
> derrell.lip...@unwireduniverse.com>:
>
>  The new Waypoints feature looks nice. I wonder if there are some useful
> but missing pieces, though, Let's say you've set a waypoint at 75% in order
> to load additional data at the end, to implement infinite scrolling. The
> user then scrolls past 75%, causing the event whose handler requests more
> data. Before the new data has arrived, the user scrolls backwards (towards
> the beginning of the list) so again passes the 75% waypoint, which again
> requests yet more data. The second of those events should not have
> requested more data at the end because the user is scrolling towards the
> beginning.
>
>  It seems that two changes would be useful:
>
>  1. In the setWaypointsY() method, allow specifying whether a waypoint
> event should be generated when passing the waypoint scrolling down, up, or
> either. One possible implementation is:
>
>  scrollContainer.setWaypointsY(
>   [
>     "0%",
>     { waypoint : "25%",  activatedOn : "scrolldown" },
>     "50%",
>     { waypoint : "75%",  activatedOn : "scrollup" },
>     { waypoint : "100%", activatedOn : "scrollupdown" },
>     200,
>     ".waypoint"
>   ]);
>
>  which would activate the 25% waypoint event only when scrolling down;
> the 75% waypoint only when scrolling up; and all others when scrolling in
> either direction. (Note that the map can be used for events for either
> direction, as with 100%, or the map can be excluded in those cases, as with
> 50%.)
>
>  Additionally, the event payload can indicate which direction scrolling
> has occurred:
>
>  {
>   "offset": 0,
>   "input": "10%",
>   "index": 0,
>   "element" : 0,
>   "direction" : "scrolldown"
> }
>
>  For your consideration,
>
>  Derrell
>
>
> On Fri, Aug 15, 2014 at 8:07 AM, qooxdoo News <webmas...@qooxdoo.org>
> wrote:
>
>>     qooxdoo News <http://news.qooxdoo.org/>
>> ------------------------------
>>
>> The week in qooxdoo (2014-08-15)
>> <http://feedproxy.google.com/~r/qooxdoo/news/content/~3/pJY5EALvcIc/the-week-in-qooxdoo-2014-08-15?utm_source=feedburner&utm_medium=email>
>>
>> Posted: 15 Aug 2014 04:56 AM PDT
>>
>> This week, we have been busy in the mobile part of the framework, as you
>> might have already read in our separate blog post
>> <http://news.qooxdoo.org/waypoints-feature-added-to-qx-mobile> about the
>> new waypoint feature. This is a handy new feature you might want to try in
>> the playground <http://tinyurl.com/llp9yef> for yourself. This also
>> enables you to implement a commonly used pattern called *pull to refresh
>> <http://bugzilla.qooxdoo.org/show_bug.cgi?id=8535>*.
>>
>> We have also been busy in refactoring the picker widget
>> <http://demo.qooxdoo.org/devel/mobileshowcase/index.html#%2Fdialog>, but
>> more details on that will be covered in a blog post coming next week.
>>
>> For a complete list of all tasks accomplished during the last working
>> week, see this bugzilla query
>> <http://bugzilla.qooxdoo.org/buglist.cgi?query_format=advanced&resolution=FIXED&chfieldfrom=2014-08-08&chfieldto=2014-08-15&chfield=resolution>
>> .
>>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:yIl2AUoC8zA>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:D7DqB2pKExk>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:dnMXMwOfBR0>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:V_sGLiPBpWU>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:F7zBnMyn0Lo>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:gIN9vFwOqvQ>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=pJY5EALvcIc:muaGoYpD-8c:qj6IDK7rITs>
>>
>> Waypoints feature added to qx.Mobile
>> <http://feedproxy.google.com/~r/qooxdoo/news/content/~3/ssSDrS7IFHs/waypoints-feature-added-to-qx-mobile?utm_source=feedburner&utm_medium=email>
>>
>> Posted: 14 Aug 2014 08:16 AM PDT
>>
>> <http://demo.qooxdoo.org/devel/mobileshowcase/index.html#%2Flist>We
>> enhanced the qx.Mobile pageEnd logic and added a scroll waypoint
>> feature. It makes it possible to execute code whenever you scroll to a
>> pre-defined offset. This is very useful if you want to trigger an
>> animation/action when the user scrolls to specified vertical/horizontal
>> point. This feature is also necessary if you want to implement infinite
>> scrolling.
>>
>> The waypoint feature can be used like this:
>>
>> var scrollContainer = page._getScrollContainer();
>> scrollContainer.setWaypointsY(["0%","50%","100%",200,".waypoint"]);
>>
>> You can add percentage-based waypoints by adding a string like "20%" or
>> just add numbers for applying pixel-based offsets. Additionally you can
>> determine waypoints through a CSS selector query
>> <https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors>
>> .
>>
>> Whenever a waypoint triggers, a qx.event.type.Data fires on the scroll
>> container:
>>
>> scrollContainer.addListener("waypoint", function(evt) {
>>   console.log("Waypoint reached:" + evt.getData());
>> }, this);
>>
>> The payload of the waypoint event looks like this:
>>
>> {
>> "offset": 0,
>> "input": "10%",
>> "index": 0,
>> "element" : 0
>> }
>>
>>
>>    - offset contains the scroll offset in pixel.
>>    - input is the waypoint condition you passed through the array and
>>    which triggered this event.
>>    - index identifies this waypoint relative to its position inside the
>>    waypoint array you have passed.
>>    - element contains the element index found through your selector.
>>    e.g. you have five elements with ‘.waypoint’ class inside your scroll
>>    container, and user scrolls to the fifth element with this identifier, 
>> then
>>    element would be 4. This value is only relevant for waypoint rules based
>>    upon a selector. For numbers and percentage-based rules it is always
>>    null.
>>
>> Have a look at this feature at the qx.Mobile List demo
>> <http://demo.qooxdoo.org/devel/mobileshowcase/index.html#%2Flist> or
>> check out the demo source code
>> <https://github.com/qooxdoo/qooxdoo/blob/master/application/mobileshowcase/source/class/mobileshowcase/page/List.js>
>> .
>>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:yIl2AUoC8zA>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:D7DqB2pKExk>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:dnMXMwOfBR0>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:V_sGLiPBpWU>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:F7zBnMyn0Lo>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:gIN9vFwOqvQ>
>> <http://feeds.feedburner.com/~ff/qooxdoo/news/content?a=ssSDrS7IFHs:jFJ3fAJVFJc:qj6IDK7rITs>
>>      You are subscribed to email updates from qooxdoo News
>> <http://news.qooxdoo.org/>
>> To stop receiving these emails, you may unsubscribe now
>> <http://feedburner.google.com/fb/a/mailunsubscribe?k=8bEQDa09ojNmRCkeos18kn7BncI>
>> . Email delivery powered by Google  Google Inc., 20 West Kinzie, Chicago
>> IL USA 60610
>>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to