},
require: {editor: '^^afGuiEditor'},
controller: function($scope, crmApi4, dialogService, afGui) {
- var ts = $scope.ts = CRM.ts(),
+ var ts = $scope.ts = CRM.ts('org.civicrm.afform_admin'),
ctrl = this;
this.$onInit = function() {
}
};
+ this.sortableOptions = {
+ handle: '.af-gui-bar',
+ connectWith: '[ui-sortable]',
+ cancel: 'input,textarea,button,select,option,a,.dropdown-menu',
+ placeholder: 'af-gui-dropzone',
+ containment: '#afGuiEditor-canvas-body'
+ };
+
$scope.isSelectedFieldset = function(entityName) {
return entityName === ctrl.editor.getSelectedEntityName();
};
model.block = afGui.meta.blocks[$scope.block.original].block;
}
else {
- model.block = ctrl.getFieldEntityType('id') || '*';
+ model.block = ctrl.getFieldEntityType();
}
dialogService.open('saveBlockDialog', '~/afGuiEditor/saveBlock.html', model, options)
.then(function(block) {
}
});
}
- if (!entityType && afGui.getField(searchDisplay['saved_search.api_entity'], fieldName)) {
+ if (!entityType && fieldName && afGui.getField(searchDisplay['saved_search.api_entity'], fieldName)) {
entityType = searchDisplay['saved_search.api_entity'];
}
if (entityType) {
return false;
}
});
- return entityType;
+ return entityType || _.map(afGui.meta.searchDisplays, 'saved_search.api_entity')[0];
};
}