-
-
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.
Afform - Predefined container styles
Adds a predefined "Panel Pane" style, for creating dashboards.
- Loading branch information
Showing
8 changed files
with
84 additions
and
3 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
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
31 changes: 31 additions & 0 deletions
31
ext/afform/admin/ang/afGuiEditor/afGuiMenuItemStyle.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,31 @@ | ||
// https://civicrm.org/licensing | ||
(function(angular, $, _) { | ||
"use strict"; | ||
|
||
// Menu item to control the border property of a node | ||
angular.module('afGuiEditor').component('afGuiMenuItemStyle', { | ||
templateUrl: '~/afGuiEditor/afGuiMenuItemStyle.html', | ||
bindings: { | ||
node: '=' | ||
}, | ||
controller: function($scope, afGui) { | ||
var ts = $scope.ts = CRM.ts('org.civicrm.afform_admin'), | ||
ctrl = this; | ||
|
||
// Todo: Make this an option group so other extensions can add to it | ||
this.styles = [ | ||
{name: 'af-container-style-pane', label: ts('Panel Pane')} | ||
]; | ||
|
||
$scope.getSetStyle = function(style) { | ||
var options = _.map(ctrl.styles, 'name'); | ||
if (arguments.length) { | ||
afGui.modifyClasses(ctrl.node, options, style); | ||
} | ||
return _.intersection(afGui.splitClass(ctrl.node['class']), options)[0] || ''; | ||
}; | ||
|
||
} | ||
}); | ||
|
||
})(angular, CRM.$, CRM._); |
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,7 @@ | ||
<div class="af-gui-field-select-in-dropdown form-inline" ng-click="$event.stopPropagation()"> | ||
<label>{{:: ts('Style:') }}</label> | ||
<select class="form-control" ng-model="getSetStyle" ng-model-options="{getterSetter: true}"> | ||
<option value="">{{:: ts('None') }}</option> | ||
<option ng-repeat="style in $ctrl.styles" value="{{:: style.name }}">{{:: style.label }}</option> | ||
</select> | ||
</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