-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23702 from colemanw/loadingPlaceholders
SearchKit - Make loading placeholders configurable
- Loading branch information
Showing
11 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function(angular, $, _) { | ||
"use strict"; | ||
|
||
angular.module('crmSearchAdmin').component('searchAdminPlaceholderConfig', { | ||
bindings: { | ||
display: '<', | ||
}, | ||
templateUrl: '~/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html', | ||
controller: function($scope) { | ||
var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'), | ||
ctrl = this; | ||
|
||
this.$onInit = function() { | ||
// Legacy support | ||
if (!('placeholder' in this.display.settings)) { | ||
this.display.settings.placeholder = 5; | ||
} | ||
}; | ||
|
||
this.togglePlaceholder = function() { | ||
this.display.settings.placeholder = this.display.settings.placeholder ? 0 : 5; | ||
}; | ||
|
||
} | ||
}); | ||
|
||
})(angular, CRM.$, CRM._); |
9 changes: 9 additions & 0 deletions
9
ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="form-inline"> | ||
<div class="checkbox-inline form-control" title="{{:: ts('Show wireframe placeholder results while waiting for data') }}"> | ||
<label> | ||
<input type="checkbox" ng-checked="$ctrl.display.settings.placeholder" ng-click="$ctrl.togglePlaceholder()"> | ||
<span>{{:: ts('Loading Placeholders') }}</span> | ||
</label> | ||
<input ng-if="$ctrl.display.settings.placeholder" type="number" min="0" step="1" class="form-control" ng-model="$ctrl.display.settings.placeholder" ng-model-options="{updateOn: 'blur'}"> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ext/search_kit/ang/crmSearchDisplayGrid/crmSearchDisplayGridLoading.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- Placeholder shown during ajax loading --> | ||
<div ng-repeat="num in [1,2,3,4,5] track by $index" style="width: 100px; height: 50px;"> | ||
<div ng-repeat="num in $ctrl.placeholders" style="width: 100px; height: 50px;"> | ||
<div class="crm-search-loading-placeholder"></div> | ||
</div> |
2 changes: 1 addition & 1 deletion
2
ext/search_kit/ang/crmSearchDisplayList/crmSearchDisplayListLoading.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- Placeholder shown during ajax loading --> | ||
<li ng-repeat="num in [1,2,3,4,5] track by $index"> | ||
<li ng-repeat="num in $ctrl.placeholders"> | ||
<div class="crm-search-loading-placeholder"></div> | ||
</li> |
2 changes: 1 addition & 1 deletion
2
ext/search_kit/ang/crmSearchDisplayTable/crmSearchDisplayTableLoading.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters