make some input elements readonly(they can gain focus) instead of disabled

This commit is contained in:
j 2015-02-27 12:28:07 +05:30
parent af9f83b08f
commit 013090893d

View file

@ -223,7 +223,7 @@ oml.ui.usersDialog = function() {
.appendTo($form); .appendTo($form);
Ox.Input({ Ox.Input({
disabled: true, readonly: true,
label: Ox._('Your Public Key'), label: Ox._('Your Public Key'),
labelWidth: 128, labelWidth: 128,
value: oml.user.id, value: oml.user.id,
@ -235,7 +235,7 @@ oml.ui.usersDialog = function() {
.appendTo($form); .appendTo($form);
Ox.Input({ Ox.Input({
disabled: true, readonly: true,
label: Ox._('Download Link'), label: Ox._('Download Link'),
labelWidth: 128, labelWidth: 128,
value: 'http://openmedialibrary.com/#download', value: 'http://openmedialibrary.com/#download',
@ -298,11 +298,11 @@ oml.ui.usersDialog = function() {
isPeer = Ox.contains(peerIds, data.value), isPeer = Ox.contains(peerIds, data.value),
isValid = oml.validatePublicKey(data.value), isValid = oml.validatePublicKey(data.value),
peer = Ox.getObjectById(users, data.value), peer = Ox.getObjectById(users, data.value),
disabled = isOwn || isPeer || !isValid; readonly = isOwn || isPeer || !isValid;
$buttons[0].options({ $buttons[0].options({
disabled: disabled readonly: readonly
}); });
if (data.value && disabled) { if (data.value && readonly) {
$warning.html( $warning.html(
isOwn ? 'That\'s your own public key.' isOwn ? 'That\'s your own public key.'
: isPeer ? 'That\'s ' : isPeer ? 'That\'s '
@ -326,7 +326,7 @@ oml.ui.usersDialog = function() {
} else { } else {
Ox.Input({ Ox.Input({
disabled: true, readonly: true,
label: Ox._('Username'), label: Ox._('Username'),
labelWidth: 128, labelWidth: 128,
value: user.username, value: user.username,
@ -338,7 +338,7 @@ oml.ui.usersDialog = function() {
.appendTo($form); .appendTo($form);
Ox.Input({ Ox.Input({
disabled: true, readonly: true,
label: Ox._('Public Key'), label: Ox._('Public Key'),
labelWidth: 128, labelWidth: 128,
value: user.id, value: user.id,
@ -350,7 +350,7 @@ oml.ui.usersDialog = function() {
.appendTo($form); .appendTo($form);
Ox.Input({ Ox.Input({
disabled: true, readonly: true,
label: Ox._('Contact'), label: Ox._('Contact'),
labelWidth: 128, labelWidth: 128,
value: user.contact || '', value: user.contact || '',