Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
Forked from kenhkan/index.js
Created September 14, 2012 21:04
Show Gist options
  • Save tonylukasavage/3724810 to your computer and use it in GitHub Desktop.
Save tonylukasavage/3724810 to your computer and use it in GitHub Desktop.
exports.* does not effect on-screen elements
$.hide.addEventListener("click", function(e) {
// don't create a new instance, use the one the markup creates for you
// you when you use the <Require> tag.
//
// var views = Alloy.createController("views");
// views.hide();
$.views.hide();
});
$.index.open();
<Alloy>
<Window class="container">
<Require src="views" id="views"/>
<Button id="hide">Hide The View</Button>
</Window>
</Alloy>
// Would hide the 'theView' button
$.theView.addEventListener("click", function() { $.theView.hide(); });
// Would *NOT* hide the 'theView' button
exports.hide = function() { $.theView.hide(); };
<Alloy>
<View class="container">
<Button id="theView">The View</Button>
</View>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment