[英]Ember.js and Twitter Bootstrap Popover
我試圖部署酥料餅的使用ember.js但不知道如何去做。
popover的內容必須是ember的一個元素才能與之交互。
我一直在看https://github.com/jzajpt/ember-bootstrap,但不包括popover元素。
有任何想法嗎? 謝謝!
我想,你嘗試做的事情永遠不會奏效,因為如果你的鼠標離開控制器,那么彈出窗口就會消失!
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"]')
});
});
}
});
在視圖的didInsertElement方法中,您可以執行類似的操作
didInsertElement: function() {
var self = this;
this.$().popover({
title: self.get('tooltipTitle'),
content: self.get('tooltipContent')
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.