Skip to content

Instantly share code, notes, and snippets.

@hvgotcodes
Created September 28, 2010 21:43
Show Gist options
  • Save hvgotcodes/601850 to your computer and use it in GitHub Desktop.
Save hvgotcodes/601850 to your computer and use it in GitHub Desktop.
render: function(context, firstTime) {
var hints = this.get('hints');
console.log('render content %@'.fmt(hints));
var hHeight = this.get('hintHeight');
var hWidth = this.get('hintWidth');
if (hints) {
hints.forEach(function(item, i) {
var top = 0;
var left = ((i % 3) + 1) * hWidth;
var style = 'position:relative; height:%@;width:%@;top:%@;left:%@;'.fmt(hHeight, hWidth, 0, left);
context = context.
begin('div').
addClass('hint').
attr('style', style).
attr('id', '%@-%@'.fmt(SC.guidFor(this), i)).
push(item.get('hint')).
end();
});
}
sc_super();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment