mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
Testing new scroller view
This commit is contained in:
1793
dist/js/ionic.js
vendored
1793
dist/js/ionic.js
vendored
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,16 @@
|
|||||||
(function(ionic) {
|
(function(ionic) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
ionic.views.Scroll = function(opts) {
|
/**
|
||||||
|
* The Scroll view is a container that suppoerts complex
|
||||||
|
* and customizable scroll behavior.
|
||||||
|
*
|
||||||
|
* This is a replacement for the buggy and shallow -webkit-overflow-scroll: touch.
|
||||||
|
* which is fine for web apps that want to have overflow scrolling containers,
|
||||||
|
* but HTML5 hybrid apps benefit from the same kind of scroll abstractions
|
||||||
|
* seen on iOS or Android.
|
||||||
|
*/
|
||||||
|
ionic.views.ScrollView = function(opts) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
// Extend the options with our defaults
|
// Extend the options with our defaults
|
||||||
@ -10,15 +19,11 @@
|
|||||||
dragThresholdY: 10,
|
dragThresholdY: 10,
|
||||||
resistance: 2,
|
resistance: 2,
|
||||||
scrollEventName: 'momentumScrolled',
|
scrollEventName: 'momentumScrolled',
|
||||||
intertialEventInterval: 50
|
intertialEventInterval: 50,
|
||||||
|
showScrollBar: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.el = opts.el;
|
ionic.Utils.extend(this, opts);
|
||||||
this.decelerationRate = opts.decelerationRate;
|
|
||||||
this.dragThresholdY = opts.dragThresholdY;
|
|
||||||
this.resistance = opts.resistance;
|
|
||||||
this.scrollEventName = opts.scrollEventName;
|
|
||||||
this.inertialEventInterval = opts.inertialEventInterval;
|
|
||||||
|
|
||||||
// Listen for drag and release events
|
// Listen for drag and release events
|
||||||
ionic.onGesture('drag', function(e) {
|
ionic.onGesture('drag', function(e) {
|
||||||
|
|||||||
1771
js/views/scrollerView.js
Normal file
1771
js/views/scrollerView.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@
|
|||||||
<a href="#" class="button button-danger button-clear">Delete</a>
|
<a href="#" class="button button-danger button-clear">Delete</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="scroller" class="scroll" style="margin-top:44px">
|
<div id="scroller" class="scroll" style="margin-top:44px">
|
||||||
<!--<div id="filler" style="height: 1400px; background: url('tree_bark.png') repeat;"></div>-->
|
<div id="filler" style="height: 1400px; background: url('tree_bark.png') repeat;"></div>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user