/[refeed]/trunk/script/app.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/script/app.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8 by dpavlin, Wed Jul 5 00:27:49 2006 UTC revision 9 by dpavlin, Thu Jul 6 17:31:48 2006 UTC
# Line 185  Refeed.App.archiveAll = function() Line 185  Refeed.App.archiveAll = function()
185   * selection and actual browser scrolling if necessary.   * selection and actual browser scrolling if necessary.
186   *   *
187   * @param   int     direction   -1 means scroll up, +1 means scroll down   * @param   int     direction   -1 means scroll up, +1 means scroll down
188     * @param   boolean scrollWrap  wrap when scrolling (default: true)
189   * @return  boolean False   * @return  boolean False
190   */   */
191  Refeed.App.doScroll = function(direction)  Refeed.App.doScroll = function(direction, scrollWrap)
192  {  {
193      if(this.listedThings.length == 0) {      if(this.listedThings.length == 0) {
194          return false;          return false;
195      }      }
196        
197      var newThing = null;      var newThing = null;
198      var winBox = this.getWindowBox();      var winBox = this.getWindowBox();
199      var docBox = this.getDocumentBox();      var docBox = this.getDocumentBox();
# Line 200  Refeed.App.doScroll = function(direction Line 201  Refeed.App.doScroll = function(direction
201      var scrolledToBottom = winBox.bottom() >= docBox.bottom();      var scrolledToBottom = winBox.bottom() >= docBox.bottom();
202      var scrolledToTop = winBox.top() <= 0;      var scrolledToTop = winBox.top() <= 0;
203    
204            if (scrollWrap == null) scrollWrap = true;
205    
206      if(!scrolledToBottom && !scrolledToTop && (this.selectedThing == null || !winBox.isOverlapping(this.selectedThing.getNodeBox()))) {      if(!scrolledToBottom && !scrolledToTop && (this.selectedThing == null || !winBox.isOverlapping(this.selectedThing.getNodeBox()))) {
207          // we're scrolled someplace in the middle, and there's nothing          // we're scrolled someplace in the middle, and there's nothing
208          // selected in view, so find something appropriate within the          // selected in view, so find something appropriate within the
# Line 216  Refeed.App.doScroll = function(direction Line 219  Refeed.App.doScroll = function(direction
219              // just pick the next thing              // just pick the next thing
220              newThing = this.listedThings[newPos];              newThing = this.listedThings[newPos];
221    
222          } else {          } else if (scrollWrap) {
223              // looks like we're set to scroll off the edge of the document              // looks like we're set to scroll off the edge of the document
224              if(this.selectedThing == null) {              if(this.selectedThing == null) {
225                  // ...and nothing is selected,                  // ...and nothing is selected,
# Line 242  Refeed.App.doScroll = function(direction Line 245  Refeed.App.doScroll = function(direction
245                      window.scrollTo(0, docBox.bottom());                      window.scrollTo(0, docBox.bottom());
246                  }                  }
247              }              }
248          }          } else {
249                            // no scrollWrap
250                            return false;
251                    }
252      }      }
253            
254      this.selectThing(newThing);      this.selectThing(newThing);

Legend:
Removed from v.8  
changed lines
  Added in v.9

  ViewVC Help
Powered by ViewVC 1.1.26