Merge pull request #5937 from nextcloud/backend-can-be-wrong---sometimes

display error icon on non-success
This commit is contained in:
Morris Jobke 2017-08-08 16:18:56 +02:00 committed by GitHub
commit c119f66e75
3 changed files with 20 additions and 7 deletions

View File

@ -168,7 +168,7 @@ input#openid, input#webdav {
width: 17em;
}
#personal-settings-container > div > form span[class^="icon-checkmark"] {
#personal-settings-container > div > form span[class^="icon-checkmark"], #personal-settings-container > div > form span[class^="icon-error"] {
position: absolute;
left: 228px;
top: 82px;

View File

@ -108,9 +108,12 @@
}
});
$.when(savingData).done(function() {
//OC.msg.finishedSaving('#personal-settings-container .msg', result)
self._showInputChangeSuccess(field);
$.when(savingData).done(function(data) {
if (data.status === "success") {
self._showInputChangeSuccess(field);
} else {
self._showInputChangeFail(field);
}
});
},
@ -178,6 +181,14 @@
}
},
_showInputChangeFail: function(field) {
var $icon = this.$('#' + field + 'form > .icon-error');
$icon.fadeIn(200);
setTimeout(function() {
$icon.fadeOut(300);
}, 2000);
},
_setFieldScopeIcon: function(field, scope) {
var $icon = this.$('#' + field + 'form > h2 > span');
$icon.removeClass('icon-password');

View File

@ -66,7 +66,7 @@
<div class="inlineblock button primary" id="sendcropperbutton"><?php p($l->t('Choose as profile picture')); ?></div>
</div>
</div>
<span class="icon-checkmark hidden"/>
<span class="icon-checkmark hidden"></span>
<?php if($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
<?php } ?>
@ -84,7 +84,8 @@
<?php if(!$_['displayNameChangeSupported']) { print_unescaped('disabled="1"'); } ?>
value="<?php p($_['displayName']) ?>"
autocomplete="on" autocapitalize="none" autocorrect="off" />
<span class="icon-checkmark hidden"/>
<span class="icon-checkmark hidden" ></span>
<span class="icon-error hidden" ></span>
<?php if($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
<?php } ?>
@ -119,7 +120,8 @@
<br />
<em><?php p($l->t('For password reset and notifications')); ?></em>
<?php } ?>
<span class="icon-checkmark hidden"/>
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
<?php } ?>