Skip to content

Commit

Permalink
增加初始化选项threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
maxzhang committed Nov 6, 2013
1 parent 393d290 commit c7c5dcb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dragloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
options = options || {};
this.options = options;
this.ct = options.ct ? (typeof options.ct === 'string' ? document.querySelector(options.ct) : options.ct) : document.body;
if (typeof options.dragDownThreshold === 'undefined') options.dragDownThreshold = this.threshold;
if (typeof options.dragUpThreshold === 'undefined') options.dragUpThreshold = this.threshold;
if (typeof options.threshold === 'undefined') options.threshold = 80;
if (typeof options.dragDownThreshold === 'undefined') options.dragDownThreshold = options.threshold;
if (typeof options.dragUpThreshold === 'undefined') options.dragUpThreshold = options.threshold;

this._events = {};
this._draggable = true;
Expand All @@ -71,8 +72,6 @@
load: 'load'
},

threshold: 80,

_createDragDownRegion: function() {
this._removeDragDownRegion();
this.header = document.createElement('div');
Expand Down

0 comments on commit c7c5dcb

Please sign in to comment.