【发布时间】:2015-02-08 01:31:34
【问题描述】:
我有 modal.html:
<template name="modal">
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title">Dialog</h2>
</div>
<div class="modal-body">
<p>
Dialogs are typically used to prompt users to make a specific decision
as part of or before continuing with a task or process. They can be used
to inform users about a specific issue, to confirm particularly important
actions, or to explain significant ramifications of an action before
allowing the user to proceed.
</p>
</div>
<div class="modal-footer">
<button class="btn btn-flat pull-left">More info...</button>
<button class="btn btn-flat" data-dismiss="modal">Close</button>
<button class="btn btn-flat btn-primary" data-dismiss="modal">Save</button>
</div>
</div>
</div>
</div>
</template>
我有 transfer.html 和 transfer.js
<template name="transfer">
<!-- Somewhere inside template -->
<a href="#" class="btn small-btn btn-fab reminder-btn" id="lock-pay" data-toggle="tooltip" data-placement="right" title="foo"><i class="fa fa-lock"></i></a>
</template>
Template.transfer.events({
'click #lock-pay': function(event) {
event.preventDefault();
$('#modal').modal('show');
}
})
我尝试将模态模板与我的传输放在同一个文件中,但这也不起作用
【问题讨论】:
-
我写了一个包,使它易于使用 bootstrap 3 模态。随时use it 或read the code。
标签: javascript jquery twitter-bootstrap meteor