Skip to content

Instantly share code, notes, and snippets.

@brock555
Created November 9, 2012 21:38
Show Gist options
  • Save brock555/4048422 to your computer and use it in GitHub Desktop.
Save brock555/4048422 to your computer and use it in GitHub Desktop.
NeighborsTableView Module
// Generated by CoffeeScript 1.3.3
(function() {
var NeighborsTableView;
NeighborsTableView = function(params) {
var makeRow, neighborData, row, tableRows, view, _ref;
neighborData = params.data;
if ((_ref = params.scale) == null) {
params.scale = 1;
}
makeRow = function(r) {
var neighborRow, rowView;
neighborRow = Ti.UI.createTableViewRow({
className: 'neighbors',
borderWidth: 0,
borderColor: 'transparent',
height: 200 / params.scale
});
rowView = Ti.UI.createImageView({
image: 'graphics/social/panel_baseTall.png',
width: '100%',
height: 200 / params.scale,
top: 0,
left: 0
});
neighborRow.add(rowView);
return neighborRow;
};
tableRows = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = neighborData.length; _i < _len; _i++) {
row = neighborData[_i];
_results.push(makeRow(row));
}
return _results;
})();
view = Ti.UI.createTableView({
data: tableRows,
allowsSelection: 'false',
borderWidth: 0,
borderColor: 'transparent',
separatorColor: 'transparent',
rowBackgroundColor: 'transparent',
backgroundColor: 'transparent',
rowHeight: 205 / params.scale,
maxRowHeight: 205 / params.scale,
minRowHeight: 205 / params.scale,
size: {
width: typeof params.width === "function" ? params.width('100%') : void 0,
height: typeof params.height === "function" ? params.height('100%') : void 0
}
});
return view;
};
module.exports = NeighborsTableView;
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment