Tag: eco

Backbone,模板内的Bootstrap模态未显示

我正在尝试为每个post生成一个模态,以便每个post都有一个包含post内容的模式(最终是评论)。 单击注释链接时,将显示模式。 问题是我必须为每个post创建一个bootstrap模态块,所以我决定在我的骨干模板中这样做最容易。 为什么这不起作用? 这是我的代码: 应用程序/资产/模板/职位/ index.jst.eco <a href="#”>Comment <div class="modal" id="post-” tabindex=”-1″ role=”dialog” aria-labelledby=”myModalLabel” aria-hidden=”true”> 应用程序/资产/ Java脚本/路由器/ posts_router.js.coffee class Voice.Routers.Posts extends Backbone.Router routes: ”: ‘index’ ‘:id’: ‘show’ initialize: -> @collection = new Voice.Collections.Posts() @collection.fetch() index: -> view = new Voice.Views.PostsIndex(collection: @collection) $(‘#container’).html(view.render().el) show: (id) -> $(“#post-#{id}”).modal(‘show’) js控制台中没有错误,似乎没有显示模态。 每个post都有一个模态块,其html id字段等于“post-(postid)” 任何帮助深表感谢!