Last active
October 18, 2016 17:40
-
-
Save markprzepiora/f5b8c0938843af58c306bb2bd54a21e7 to your computer and use it in GitHub Desktop.
Clicked outside
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
clickOutside(event) { | |
const $target = Ember.$(event.target); | |
const clickedOutside = typeof $target.data('outside') !== 'undefined'; | |
alert("Clicked outside: " + (clickedOutside ? "yes" : "no")); | |
}, | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.outside { | |
background: yellow; | |
padding: 20px; | |
position: fixed; | |
width: 100%; | |
height: 100%; | |
left: 0; | |
top: 0; | |
} | |
.inside { | |
background: white; | |
padding: 20px; | |
margin: 20px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.5", | |
"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.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment