Created
September 7, 2016 04:17
-
-
Save h6w/db7cd56f626f2647f24f18c288e2218b to your computer and use it in GitHub Desktop.
fastn select bloat?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastn('picker', { | |
options: [ | |
{ | |
something: '5 minutes', | |
someKey: '00:00:05:00' | |
}, | |
{ | |
something: '1 hour', | |
someKey: '00:01:00:00' | |
}, | |
{ | |
something: '4 hours', | |
someKey: '00:04:00:00' | |
}, | |
{ | |
something: '1 day', | |
someKey: '01:00:00:00' | |
}, | |
{ | |
something: '1 week', | |
someKey: '07:00:00:00' | |
} | |
], | |
itemTemplate: function(model, scope, select, renderItem){ | |
var item = renderItem(model.get('item.something')); | |
item.on('click', select); | |
return item; | |
}, | |
currentTemplate: function(model){ | |
var selectedValue = model.get('item.something'); | |
return crel('div', selectedValue ? 'You picked ' + model.get('item.something') : 'Pick a value'); | |
}, | |
id: 'duration', | |
value: '00:00:05:00', | |
onchange: 'value:value' | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ahah! This looks much better: