【发布时间】:2015-04-25 19:04:53
【问题描述】:
我在使用 Ember 显示模式时遇到问题。我已经按照说明书进行操作,但是当我单击模态按钮时,它只显示叠加层而不是模态本身。
这是我的要点:https://gist.github.com/sunocean-sand/e11111cea44274417012
感谢您的帮助!
【问题讨论】:
标签: css twitter-bootstrap ember.js
我在使用 Ember 显示模式时遇到问题。我已经按照说明书进行操作,但是当我单击模态按钮时,它只显示叠加层而不是模态本身。
这是我的要点:https://gist.github.com/sunocean-sand/e11111cea44274417012
感谢您的帮助!
【问题讨论】:
标签: css twitter-bootstrap ember.js
我的一个应用程序中有一个类似的实现。尝试将您的 routes/application.js 更改为以下代码。我相信你的问题是你没有使用 Bootstrap 的Programmatic API。
export default Ember.Route.extend({
actions: {
openModal: function(modal) {
this.render(modal, {
into: 'application',
outlet: 'modal'
});
return Ember.run.schedule('afterRender', function() {
Ember.$('.modal').modal('show');
});
},
closeModal: function() {
Ember.$('.modal').modal('hide');
return this.disconnectOutlet({
outlet: 'modal',
parentView: 'application'
});
}
}
});
【讨论】: