SERblY, может так?
<button class="btn btn-primary btn-lg" id="show_notepad" data-modal="#myModalnote">
Блокнот
</button>
<!-- Modal -->
<div class="modal fade" id="myModalnote" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Блокнот</h4>
</div>
<div class="modal-body" data-path="{%$settings.path%}notepad_ajax/">
Loading...
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/javascript">
$(function(){
$('#show_notepad').click(function(){
var $t=$(this);
if($t.attr('disabled')!==undefined)
return;
var $modal=$($t.attr('disabled',true).data('modal')),
$modal_body=$modal.find('.modal-body');
$modal.modal('show');
$.post($modal_body.data('path'),function(res){
$modal_body.html(res);
}).complete(function(){
$t.removeAttr('disabled');
});
});
});
</script>
|