Previously, limit was a number input which could be disabled by entering the number '0'.
That's less intuitive than a checkbox.
},
};
+ this.toggleLimit = function() {
+ if (ctrl.display.settings.limit) {
+ ctrl.display.settings.limit = 0;
+ if (ctrl.display.settings.pager) {
+ ctrl.display.settings.pager = false;
+ }
+ } else {
+ ctrl.display.settings.limit = CRM.crmSearchAdmin.defaultPagerSize;
+ }
+ };
+
// Drag-n-drop settings for reordering columns
this.sortableOptions = {
connectWith: '.crm-search-admin-edit-columns',
{{ symbol.label }}
</option>
</select>
- <div class="form-inline">
</div>
- <label for="crm-search-admin-display-limit">{{:: ts('Results to display (0 for no limit):') }}</label>
- <input id="crm-search-admin-display-limit" type="number" min="0" step="1" class="form-control" ng-model="$ctrl.display.settings.limit">
+ <div class="form-inline">
+ <div class="checkbox-inline form-control">
+ <label>
+ <input type="checkbox" ng-checked="$ctrl.display.settings.limit" ng-click="$ctrl.parent.toggleLimit()">
+ <span>{{:: ts('Limit Results') }}</span>
+ </label>
+ <input id="crm-search-admin-display-limit" ng-if="$ctrl.display.settings.limit" type="number" min="1" step="1" class="form-control" ng-model="$ctrl.display.settings.limit">
+ </div>
<div class="checkbox-inline form-control">
- <label><input type="checkbox" ng-model="$ctrl.display.settings.pager"> <span>{{:: ts('Use Pager') }}</span></label>
+ <label ng-class="{disabled: !$ctrl.display.settings.limit}">
+ <input type="checkbox" ng-model="$ctrl.display.settings.pager" ng-disabled="!$ctrl.display.settings.limit">
+ <span>{{:: ts('Use Pager') }}</span>
+ </label>
</div>
</div>
</fieldset>
<fieldset ng-include="'~/crmSearchAdmin/crmSearchAdminDisplaySort.html'"></fieldset>
<fieldset>
<div class="form-inline">
- <label for="crm-search-admin-display-limit">{{:: ts('Results to display (0 for no limit):') }}</label>
- <input id="crm-search-admin-display-limit" type="number" min="0" step="1" class="form-control" ng-model="$ctrl.display.settings.limit">
<div class="checkbox-inline form-control">
- <label><input type="checkbox" ng-model="$ctrl.display.settings.pager"> <span>{{:: ts('Use Pager') }}</span></label>
+ <label>
+ <input type="checkbox" ng-checked="$ctrl.display.settings.limit" ng-click="$ctrl.parent.toggleLimit()">
+ <span>{{:: ts('Limit Results') }}</span>
+ </label>
+ <input id="crm-search-admin-display-limit" ng-if="$ctrl.display.settings.limit" type="number" min="1" step="1" class="form-control" ng-model="$ctrl.display.settings.limit">
</div>
<div class="checkbox-inline form-control">
- <label><input type="checkbox" ng-model="$ctrl.display.settings.actions"> <span>{{:: ts('Enable Actions') }}</span></label>
+ <label ng-class="{disabled: !$ctrl.display.settings.limit}">
+ <input type="checkbox" ng-model="$ctrl.display.settings.pager" ng-disabled="!$ctrl.display.settings.limit">
+ <span>{{:: ts('Use Pager') }}</span>
+ </label>
+ </div>
+ <div class="checkbox-inline form-control">
+ <label>
+ <input type="checkbox" ng-model="$ctrl.display.settings.actions">
+ <span>{{:: ts('Enable Actions') }}</span>
+ </label>
</div>
</div>
</fieldset>
#bootstrap-theme.crm-search input[type=number] {
width: 90px;
}
+/* For display.settings.limit field */
+#bootstrap-theme.crm-search .checkbox-inline.form-control input[type=number] {
+ position: relative;
+ top: -5px;
+ right: -9px;
+}
#bootstrap-theme.crm-search .api4-add-where-group-menu {
min-width: 80px;