V8: Make "add property" shortcut work with multiple groups (#6821)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
551a54a9d6
commit
d3344e2cd4
@@ -475,6 +475,23 @@
|
||||
|
||||
/* ---------- PROPERTIES ---------- */
|
||||
|
||||
scope.addPropertyToActiveGroup = function () {
|
||||
var group = _.find(scope.model.groups, group => group.tabState === "active");
|
||||
if (!group && scope.model.groups.length) {
|
||||
group = scope.model.groups[0];
|
||||
}
|
||||
|
||||
if (!group || !group.name) {
|
||||
return;
|
||||
}
|
||||
|
||||
var property = _.find(group.properties, property => property.propertyState === "init");
|
||||
if (!property) {
|
||||
return;
|
||||
}
|
||||
scope.addProperty(property, group);
|
||||
}
|
||||
|
||||
scope.addProperty = function(property, group) {
|
||||
|
||||
// set property sort order
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
<localize key="contentTypeEditor_noGroups"></localize>
|
||||
</div>
|
||||
|
||||
<a ng-if="!sortingMode" hotkey="alt+shift+p" ng-click="addPropertyToActiveGroup()"></a>
|
||||
|
||||
<ul class="umb-group-builder__groups" ui-sortable="sortableOptionsGroup" ng-model="model.groups">
|
||||
|
||||
<li ng-repeat="tab in model.groups" ng-class="{'umb-group-builder__group-sortable': sortingMode}" data-element="group-{{tab.name}}">
|
||||
@@ -47,7 +49,7 @@
|
||||
</a>
|
||||
|
||||
<!-- TAB ACTIVE OR INACTIVE STATE -->
|
||||
<div class="umb-group-builder__group" ng-if="tab.tabState !== 'init'" ng-class="{'-active':tab.tabState=='active', '-inherited': tab.inherited, 'umb-group-builder__group-handle -sortable': sortingMode && !tab.inherited}" ng-click="activateGroup(tab)">
|
||||
<div class="umb-group-builder__group" ng-if="tab.tabState !== 'init'" ng-class="{'-active':tab.tabState=='active', '-inherited': tab.inherited, 'umb-group-builder__group-handle -sortable': sortingMode && !tab.inherited}" tabindex="0" ng-focus="activateGroup(tab)">
|
||||
|
||||
<div class="umb-group-builder__group-title-wrapper">
|
||||
|
||||
@@ -119,8 +121,6 @@
|
||||
data-element="property-add"
|
||||
class="umb-group-builder__group-add-property"
|
||||
ng-if="property.propertyState=='init' && !sortingMode"
|
||||
hotkey="alt+shift+p"
|
||||
hotkey-when="{{tab.tabState === 'active' && property.propertyState=='init'}}"
|
||||
ng-click="addProperty(property, tab)"
|
||||
ng-focus="activateGroup(tab)"
|
||||
focus-when="{{property.focus}}">
|
||||
|
||||
Reference in New Issue
Block a user