Comments (2)
Not out of the box, but you could extend Ember.Widgets.PopoverComponent
and Ember.Widgets.PopoverLinkComponent
, and add the behavior you want to the PopoverLinkComponent
in a similar way to how click
is defined now.
I'll leave this open tagged as an enhancement, since it sounds useful - we might consider adding it in the future.
from ember-widgets.
I got close on this but never got it over the finish line. Here's my code.
HoverPopoverLinkComponent = Em.Component.extend
classNames: ['hover-popover']
placement: 'top'
content: null
rootElement: '.ember-application'
fade: true
mouseEnter: ->
@showPopover()
mouseLeave: ->
@hidePopover()
showPopover: ->
popover = @get('_popover')
if popover?.get('_state') is 'inDOM'
return
else
popoverView = Em.View.extend Em.Widgets.PopoverMixin,
layoutName: 'popover-link-popover'
controller: this
targetElement: @get('element')
container: @get('container')
placement: Em.computed.alias 'controller.placement'
fade: @get('fade')
contentViewClass: IbottaWeb.PopoverContentView
classNames: 'hover-popover-content'
bodyClick: ->
popover = popoverView.create()
@set '_popover', popover
popover.appendTo @get('rootElement')
hidePopover: ->
popover = @get('_popover')
popover?.destroy()
I had trouble with it lining up correctly all the time. Hopefully this is a good start!
from ember-widgets.
Related Issues (20)
- How can a user reset the selected value in the Select widget? HOT 4
- Demo app / select widget doesn't work with Ember 1.7 HOT 6
- Ember CLI Accordion Issue HOT 2
- Have greater control over modal submit. HOT 3
- Option to disable animations while testing HOT 1
- Proposal to implement proper tab focus HOT 3
- ember-cli-ember-widgets HOT 8
- too much dependencies, too little information HOT 2
- Support additional custom actions in modal component
- search by group HOT 1
- dropdown always - is possible ? HOT 2
- Plans on porting it to Javascript (ES6)? HOT 1
- popover-link-component is "jumpy" on css fixed elements HOT 4
- Consider adding more features to the Carousel
- Uncaught TypeError: Cannot read property 'extend' of undefined HOT 1
- ember-widgets for ember 1.12.0 HOT 1
- Clean selected option on Select widget
- Only use one of the compoenents HOT 2
- Confused on how to add to ember-cli project HOT 5
- Support custom css classes for header/body/footer in modal component HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-widgets.