Sha256: 2d0c674045b6dbc17e275740250e9819594de8ac99572352546c91d97f008a60

Contents?: true

Size: 1.31 KB

Versions: 26

Compression:

Stored size: 1.31 KB

Contents

// Simple view for scrolling purposes.
// Uses two special options for setting scroll bar behavior:
//  - scrollX: true | false | 'auto'
//  - scrollY: true | false | 'auto'
var//RSence.Views
HScrollView = HControl.extend({
  controlDefaults: HControlDefaults.extend({
    scrollX: true,
    scrollY: true
  }),
  scrollToTop: function(){
    ELEM.get(this.elemId).scrollTop = 0;
  },
  scrollToBottom: function(){
    var
    elem = ELEM.get( this.elemId ),
    contentHeight = ELEM.getScrollSize(this.elemId)[1],
    viewHeight = this.rect.height;
    elem.scrollTop = contentHeight-viewHeight;
  },
  drawSubviews: function(){
    if(this.options.scrollX === 'auto' || this.options.scrollY === 'auto'){
      this.setStyle('overflow','auto');
    }
    else if(this.options.scrollX || this.options.scrollY){
      this.setStyle('overflow','scroll');
    }
    if(!this.options.scrollX){
      this.setStyle('overflow-x','hidden');
    }
    else if(this.options.scrollX === 'auto'){
      this.setStyle('overflow-x','auto');
    }
    else {
      this.setStyle('overflow-x','scroll');
    }
    if(!this.options.scrollY){
      this.setStyle('overflow-y','hidden');
    }
    else if(this.options.scrollY === 'auto'){
      this.setStyle('overflow-y','auto');
    }
    else {
      this.setStyle('overflow-y','scroll');
    }
  }
});

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rsence-pre-3.0.0.16 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.15 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.14 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.12 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.11 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.10 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.9 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.8 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.7 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.6 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.5 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.4 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.3 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.2 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.1 client/js/views/scrollview/scrollview.js
rsence-pre-3.0.0.0 client/js/views/scrollview/scrollview.js
rsence-pre-2.3.0.26 js/views/scrollview/scrollview.js
rsence-pre-2.3.0.25 js/views/scrollview/scrollview.js
rsence-pre-2.3.0.24 js/views/scrollview/scrollview.js
rsence-pre-2.3.0.23 js/views/scrollview/scrollview.js