Skip to content

Commit

Permalink
dynamic popup example
Browse files Browse the repository at this point in the history
  • Loading branch information
iasinov committed Mar 11, 2016
1 parent e18363c commit 9037a1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion dist/sf.popup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/sf.popup.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sf.popup.min.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>

<div class="js-sf-popup">
<div id="js-custom-popup">
Custom Popup
</div>

Expand Down Expand Up @@ -40,12 +40,14 @@ <h2>Hello, {{name}}</h2>
<script src="sf.form.min.js"></script>
<script src="../dist/sf.popup.min.js"></script>
<script>
var popup = sf.getInstances('popup')[0];
var popup = sf.addInstance("popup", document.getElementById('js-custom-popup'));

popup.instance.events.on("show", function (options) {
popup.getContentNode().innerHTML="<h1>Hello, World!</h1>";

popup.events.on("show", function (options) {
console.log("show");
});
popup.instance.events.on("hide", function (options) {
popup.events.on("hide", function (options) {
console.log("hide");
});
</script>
Expand Down

0 comments on commit 9037a1a

Please sign in to comment.