Skip to content
10 changes: 10 additions & 0 deletions app/components/file-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ export default Ember.Component.extend({
share() {
prompt('Ctrl + C ;-)', window.location.href);
},
embed() {
let src = window.location.href.split("?")[0];
src += "?numColumns=0";
let iframe = document.createElement("iframe");
iframe.src = src;
iframe.width = 800;
iframe.height = 600;
let embedCode = iframe.outerHTML;
prompt('Ctrl + C ;-)', embedCode);
},
fork(model) {
this.sendAction('fork', model);
},
Expand Down
7 changes: 5 additions & 2 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ body {
margin: 0;
margin-left: 0;
z-index: -1;
display: -webkit-flex;
display: flex;

@media (min-width: $screen-md-min) {
display: -webkit-flex;
display: flex;
}

.col-md-4 {
-webkit-flex-grow: 1;
Expand Down
1 change: 1 addition & 0 deletions app/templates/components/file-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<li><a {{action 'saveGist' model}} class="test-save-action">Save to Github Gist</a></li>
{{#unless model.isNew}}
<li><a {{action 'share'}}>Share Twiddle</a></li>
<li><a {{action 'embed'}}>Embed Twiddle</a></li>
{{#unless belongsToUser}}
<li><a {{action 'fork' model}} class="test-fork-action">Fork Twiddle</a></li>
{{/unless}}
Expand Down