Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember.js and Twitter Bootstrap Popover

I'm trying to deploy the popover using ember.js but not sure how to do it.

The contents of the popover must be an element of ember to interact with it.

I've been watching https://github.com/jzajpt/ember-bootstrap but does not include the popover element.

Any ideas? Thanks!

like image 1000
Javier Aranda Avatar asked Mar 05 '26 02:03

Javier Aranda


1 Answers

I think, what you try to do will never work, because if your mouse leaves the control, the popover will go away!

App.Popover = Ember.View.extend({
     name: 'myPopover',
     template: Ember.Handlebars.compile('<div class="popover" {{bindAttr name="name"}}><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title">test</h3><div class="popover-content"><p></p></div></div></div>')         
});

App.TextField = Ember.TextField.extend({
    didInsertElement: function() {
        this._super();
        var self = this;                
        Ember.run.schedule('actions', this, function() {
           self.$().popover({
                title: 'title', 
                content: 'content',
                template: $('div[name="myPopover"]')
            });     
        });
    }
});
like image 116
pjlammertyn Avatar answered Mar 07 '26 16:03

pjlammertyn