我有一个模式弹出窗口可以通过单击按钮打开。不幸的是,当第一次在浏览器中提交时,我只能在单击两次后才能看到弹出窗口。但是,一旦弹出窗口打开并关闭,我就可以在下一次尝试中单击一次来打开模式。如果我刷新浏览器也会发生同样的情况。这看起来很奇怪。任何人都可以解释为什么?我有以下代码,
按钮 HTML:
<div><button class="btn btn-danger btn-sm" ng-disabled="{{update_problem_description_disabled}}" ng-click="siverifyAddReviewModal()"><i class="glyphicon glyphicon-edit"></i> Edit Review </button>
</div>
模态 HTML:
<div class="modal-header container-fluid">
{% include "siverify_modal_header.html" %}
</div>
<form class="well form-horizontal" name="addReviewForm">
{% csrf_token %}
<div id="form-modal-body" class="modal-body">
{% verbatim %}
<table class="table" style="width:90%">
<tr>
<th><label>Review Title/Purpose*</label></th></br>
{% endverbatim %}
<td><input type="text" class="col-md-10" maxlength="256" ng-model="arform.revtitle" value="arform.revtitle" required/></td>
<!--<td><input type="text" class="col-md-10" maxlength="256" ng-init="'{{reviewtit}}'" ng-model="arform.revtitle" > {{reviewtit}} </td>-->
</tr>
<div class="modal-footer">
<button type="submit" class="btn btn-primary"
ng-disabled="addReviewForm.$invalid || rev_submit_disabled"
ng-click="addReview(arform)">Save</button>
<button type="button" ng-click="cancel()"
class="btn btn-small btn-warning">Cancel</button>
</div>
</form>
模态函数
$scope.siverifyAddReviewModal = function(wpts,mask,lyr,tech) {
// function to open modal and link to Modal Controller
$scope.addRevModal = function(wptSet) {
context = $scope.get_problem_stmt_context(dtWorklist, context_getter);
//console.log("dtw", dtWorklist);
var modalInstance = $modal.open({
backdrop: 'static',
templateUrl: '{% url 'siverify_add_review' %}',
controller: 'SiVerifyAddReviewController',
resolve:{
r_header: function(){ return wptSet; },
context: function(){ return context; }
}
});
modalInstance.result.then(function () {
datatable_worklist.refresh();
$log.info('Modal success');
//console.log(msg);
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
};
//End:function to open modal and link to Modal Controller
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)