Skip to content

Instantly share code, notes, and snippets.

@alisdair
Last active January 26, 2017 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alisdair/a465f76aa8d8e4c9228f89e1c9e52877 to your computer and use it in GitHub Desktop.
Save alisdair/a465f76aa8d8e4c9228f89e1c9e52877 to your computer and use it in GitHub Desktop.
Disabling links prototype
import Ember from 'ember';
export default Ember.Controller.extend({
disableLinks: false,
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
a.disabled, a[disabled] {
cursor: not-allowed;
color: #999;
}
a[disabled]:hover, a[disabled]:active, a.disabled:hover, a.disabled:active {
color: #999;
}
<p>
<label>
{{input type="checkbox" checked=disableLinks}}
Disable links
</label>
</p>
<ul>
<li>{{#link-to "application" disabled=disableLinks}}App{{/link-to}}</li>
<li>{{#link-href "/" disabled=disableLinks}}Root{{/link-href}}</li>
<li>{{#link-href "https://www.google.com/" disabled=disableLinks}}Google{{/link-href}}</li>
<li>{{#link-href "https://twitter.com/" disabled=disableLinks target="_blank"}}Popup{{/link-href}}</li>
</ul>
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment