Skip to content

Instantly share code, notes, and snippets.

View timanrebel's full-sized avatar
💭
I may be slow to respond.

Timan Rebel timanrebel

💭
I may be slow to respond.
View GitHub Profile
@timanrebel
timanrebel / index.js
Created June 5, 2013 16:03
Did you know it is possible to create custom XML tags in Alloy and use them?
// <<MyElement> becomes Ti.UI.createMyElement, so that doesn't work
Ti.UI.createMyElement({
id: 'myId'
});
// But give it a namespace and all of a sudden, it is translated to:
Sc.UI.createMySecondElement({
id: 'mySecondId'
})
var args = arguments || {};
/**
* Works, but you loose change listeners on the original model
*/
$.user.set(args.user.attributes);
/**
* Does not work
*/
@timanrebel
timanrebel / gist:2359385
Created April 11, 2012 13:45
Simple Ti.UI wrapper
createAlertDialog: function(config) {
return Ti.UI.createAlertDialog(config);
},
createAnimation: function(config) {
return Ti.UI.createAnimation(config);
},
createButton: function(config) {