mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix domain_user select default value (#789)
This commit is contained in:
1 parent
45600eafcb
commit
edab38cc25
1 file changed
+6
-4
@@ -19,7 +19,7 @@ const page = new NamedPage('domain_user', () => {
|
|||||||
addUserSelector.focus();
|
addUserSelector.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($role.val() === '') {
|
if (!$role.val()) {
|
||||||
$role.focus();
|
$role.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -27,9 +27,10 @@ const page = new NamedPage('domain_user', () => {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const firstRoleForAddUser = addUserDialog.$dom.find('[name="role"] option').first().val();
|
||||||
addUserDialog.clear = function () {
|
addUserDialog.clear = function () {
|
||||||
addUserSelector.clear();
|
addUserSelector.clear();
|
||||||
this.$dom.find('[name="role"]').val('');
|
this.$dom.find('[name="role"]').val(firstRoleForAddUser);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,15 +38,16 @@ const page = new NamedPage('domain_user', () => {
|
|||||||
$body: $('.dialog__body--set-role > div'),
|
$body: $('.dialog__body--set-role > div'),
|
||||||
onDispatch(action) {
|
onDispatch(action) {
|
||||||
const $role = setRolesDialog.$dom.find('[name="role"]');
|
const $role = setRolesDialog.$dom.find('[name="role"]');
|
||||||
if (action === 'ok' && $role.val() === '') {
|
if (action === 'ok' && !$role.val()) {
|
||||||
$role.focus();
|
$role.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const firstRoleForSetRole = setRolesDialog.$dom.find('[name="role"] option').first().val();
|
||||||
setRolesDialog.clear = function () {
|
setRolesDialog.clear = function () {
|
||||||
this.$dom.find('[name="role"]').val('');
|
this.$dom.find('[name="role"]').val(firstRoleForSetRole);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user