Skip to content

Instantly share code, notes, and snippets.

Created July 16, 2013 01:22
Show Gist options
  • Save anonymous/6005017 to your computer and use it in GitHub Desktop.
Save anonymous/6005017 to your computer and use it in GitHub Desktop.
title
.mfiddle-Owner-overlay {
border: 1px solid black;
padding: 15px;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MFiddle</title>
<script type="text/montage-serialization">{
"owner": {
"properties": {
"element": {"#": "component"}
}
},
"overlay": {
"prototype": "montage/ui/overlay.reel",
"properties": {
"element": {"#": "overlay"},
"anchor": {"@": "textField"}
}
},
"button": {
"prototype": "digit/ui/button.reel",
"properties": {
"label": "Show Overlay",
"element": {"#": "button"}
},
"listeners": [
{
"type": "action",
"listener": {"@": "owner"}
}
]
},
"textField": {
"prototype": "digit/ui/text-field.reel",
"properties": {
"value": "Editable text",
"element": {"#": "textField"}
}
}
}</script></head>
<body>
<div data-montage-id="component">
<button data-montage-id="button"></button>
<div data-montage-id="overlay" class="mfiddle-Owner-overlay">Hello there</div>
<input data-montage-id="textField" type="text">
</div>
</body>
</html>
var Component = require("montage/ui/component").Component;
exports.Owner = Component.specialize({
handleButtonAction: {
value: function() {
this.templateObjects.overlay.show();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment