Skip to content

Instantly share code, notes, and snippets.

@davidyang
Created September 9, 2012 07:21
Show Gist options
  • Save davidyang/3683141 to your computer and use it in GitHub Desktop.
Save davidyang/3683141 to your computer and use it in GitHub Desktop.
function Controller() {
require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
var $ = this, exports = {};
$.__views.dialerWindow = A$(Ti.UI.createWindow({
backgroundColor: "white",
id: "dialerWindow",
title: "Dialer",
navBarHidden: "true"
}), "Window", null), $.__views.phone = Alloy.createController("phone/phone", {
id: "phone"
}), $.__views.phone.setParent($.__views.dialerWindow), $.__views.dialerTab = A$(Ti.UI.createTab({
window: $.__views.dialerWindow,
title: "Dialer",
icon: "icons/dark_phone.png",
id: "dialerTab"
}), "Tab", null), $.addTopLevelView($.__views.dialerTab), _.extend($, $.__views), _.extend($, exports);
}
var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._, A$ = Alloy.A;
module.exports = Controller;
var Alloy = require('alloy'),
Backbone = Alloy.Backbone,
_ = Alloy._,
A$ = Alloy.A;
function Controller() {
require('alloy/controllers/' + 'BaseController').apply(this, Array.prototype.slice.call(arguments));
var $ = this;
var exports = {};
$.__views.dialerWindow = A$(Ti.UI.createWindow(
{backgroundColor:"white",id:"dialerWindow",title:"Dialer",navBarHidden:"true",}
),'Window', null);
$.__views.phone = Alloy.createController('phone/phone',{id:"phone",});
$.__views.phone.setParent($.__views.dialerWindow);
$.__views.dialerTab = A$(Ti.UI.createTab(
{window:$.__views.dialerWindow,title:"Dialer",icon:"icons/dark_phone.png",id:"dialerTab",}
),'Tab', null);
$.addTopLevelView($.__views.dialerTab);
// make all IDed elements in $.__views available right on the $ in a
// controller's internal code. Externally the IDed elements will
// be accessed with getView().
_.extend($, $.__views);
// Extend the $ instance with all functions and properties
// defined on the exports object.
_.extend($, exports);
}
module.exports = Controller;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment