view-list
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "view-list", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,10 +7,11 @@ var h = require('virtual-dom/h') | ||
var self = this | ||
Object.defineProperty(this, 'height', { | ||
get: function() { | ||
return this.style.height || 0 | ||
}, | ||
set: function(val) { | ||
this.style.height = val || 0 | ||
} | ||
}) | ||
// Calculate height outside of the style.height | ||
function OnHeight() {} | ||
OnHeight.prototype.hook = function(node) { | ||
setTimeout(function() { | ||
self.height = node.offsetHeight | ||
}, 10) | ||
} | ||
xtend(this, { | ||
@@ -20,3 +21,3 @@ tagName: 'ul', | ||
className: 'view-list', | ||
data: [], | ||
onHeight: new OnHeight(), | ||
onscroll: function () { | ||
@@ -32,7 +33,4 @@ self._scrollTop = this.scrollTop | ||
}, | ||
height: 500, | ||
rowHeight: 30, | ||
style: { | ||
height: 500, | ||
overflow: 'auto' | ||
}, | ||
_scrollTop: 0, | ||
@@ -39,0 +37,0 @@ _visibleStart: 0, |
Sorry, the diff of this file is not supported yet
6239
147