如何在ngdialog弹出窗口内单击最大和最小ngdialog

时间:2016-04-18 04:37:33

标签: angularjs angularjs-directive angularjs-scope angularjs-ng-repeat ng-dialog

这是我的ngcontolller代码

  $scope.openModalContant = function () {       
      ngDialog.open({
          template: 'myModalContent.html',
          scope: $scope,
          showClose: true,
          closeByDocument: false,
          closeByEscape: false,
          preCloseCallback: function(value) {
              $scope.clearFields($scope.primaryObject)
          return true;
      }
      });

  };

这是我的HTML代码

<script type="text/ng-template" id="myModalContent.html">
<div class="loading-spinner">
    <img ng-if="showLoading()" src="../../Content/images/loadingSpinner.gif" />
</div>

<div class="modal-header pad0">
    <div class="col-lg-4 mrgt15 pad0"><h4 class="modal-title">{{objectName}}</h4></div>
    <button class="btn btn-brand" type="button" ng-click="max()">max</button>
    <button class="btn btn-brand" type="button" ng-click="min()">min</button>
</div>
<div class="modal-body table-responsive">
    <div class="modal-inner list-modal-inner">
        <div class="prefill-wrapper" ng-if="preFillListModel.data.length>0">
            <div class="col-xs-12 col-sm-3 col-lg-2 pad0">
                <label class="control-label">Prefill</label>
            </div>
            <div class="col-xs-12 col-sm-9 col-lg-5 pad0">
                <select class="form-control"
                        ng-options="prefill.id as prefill.name for prefill in preFillListModel.data"
                        ng-model="prefill.id"
                        ng-change="getPrefillById(prefill,primaryObject);">
                    <option value=""> --Select-- </option>
                </select>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="primary-record-panel">
            <div>
                <div ng-if="showColumns">
                    <div columns column-properties="primaryColumns" column-data="primaryObject">
                    </div>
                </div>
            </div>
            <!-- Mid Content end -->
            <!-- Content End -->
        </div>
    </div>
</div>
<div class="modal-footer">
    <div class="pull-right col-lg-12 pad0">
        <div class="col-lg-3 pad0 mart5"><label>Save as Prefill<input type="checkbox" ng-change="prefillCheckBox(isPreFill)" ng-model="isPreFill"></label></div>
        <div ng-if="isPreFill" class="col-lg-4 mart5"><input type="text" ng-model="prefill.name" class="form-control" /></div>
        <button class="btn btn-brand" type="button" ng-click="save(primaryObject,primaryColumns)">OK</button>
        <button class="btn btn-primary" type="button" ng-click="clearFields(primaryObject)&&closeDailogue()">Cancel</button>

    </div>
</div>

所以单击最大按钮我希望弹出窗口扩展宽度和高度,当我按下min按钮时它应该最小化默认高度和宽度, 他们有可能做到这一点吗?

1 个答案:

答案 0 :(得分:0)

您必须使用两个类并在ng-class中使用它们。 一个类需要将宽度和高度设置为100%,并将min按钮设置为默认高度和宽度。

此外,您可以传递参数'windowClass',指定父类的宽度和高度。