update validation to work with block list editor inline mode
This commit is contained in:
@@ -13,14 +13,17 @@ function valTab($timeout) {
|
||||
link: function (scope, element, attr, ctrs) {
|
||||
|
||||
var form = ctrs[0];
|
||||
var tabAlias = scope.tab.alias;
|
||||
var tabAlias = scope.tab.alias;
|
||||
|
||||
let closestEditor = element.closest(".blockelement-inlineblock-editor");
|
||||
closestEditor = closestEditor.length === 0 ? element.closest(".umb-editor-sub-view") : closestEditor;
|
||||
closestEditor = closestEditor.length === 0 ? element.closest(".umb-editor") : closestEditor;
|
||||
|
||||
scope.tabHasError = false;
|
||||
|
||||
function setValidity (form) {
|
||||
if (!form.$valid) {
|
||||
var subView = element.closest(".umb-editor-sub-view");
|
||||
var editor = subView.length > 0 ? subView : element.closest(".umb-editor");
|
||||
var tabContent = editor.find("[data-element='tab-content-" + tabAlias + "']");
|
||||
var tabContent = closestEditor.find("[data-element='tab-content-" + tabAlias + "']");
|
||||
|
||||
//check if the validation messages are contained inside of this tabs
|
||||
if (tabContent.find(".ng-invalid").length > 0) {
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
border-color: @gray-8;
|
||||
}
|
||||
|
||||
.umb-editor-tab-bar {
|
||||
margin: 0;
|
||||
position: static;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
> button {
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
|
||||
Reference in New Issue
Block a user