display error icon on non-success
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
This commit is contained in:
parent
d7645ee928
commit
efa062e5ff
3 changed files with 25 additions and 11 deletions
|
@ -163,7 +163,8 @@ input#passwordbutton {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.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: relative;
|
||||
left: 90%;
|
||||
top: -44px;
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
<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 } ?>
|
||||
|
@ -99,7 +99,8 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
<?php if(!$_['displayNameChangeSupported']) { ?>
|
||||
<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
|
||||
<?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="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
|
||||
<?php } ?>
|
||||
|
@ -136,7 +137,8 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
<?php if($_['displayNameChangeSupported']) { ?>
|
||||
<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 } ?>
|
||||
|
@ -153,7 +155,7 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
value="<?php p($_['phone']) ?>"
|
||||
placeholder="<?php p($l->t('Your phone number')); ?>"
|
||||
autocomplete="on" autocapitalize="none" autocorrect="off" />
|
||||
<span class="icon-checkmark hidden"/>
|
||||
<span class="icon-checkmark hidden"></span>
|
||||
<?php if($_['lookupServerUploadEnabled']) { ?>
|
||||
<input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>">
|
||||
<?php } ?>
|
||||
|
@ -171,7 +173,7 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
placeholder="<?php p($l->t('Your postal address')); ?>"
|
||||
value="<?php p($_['address']) ?>"
|
||||
autocomplete="on" autocapitalize="none" autocorrect="off" />
|
||||
<span class="icon-checkmark hidden"/>
|
||||
<span class="icon-checkmark hidden"></span>
|
||||
<?php if($_['lookupServerUploadEnabled']) { ?>
|
||||
<input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>">
|
||||
<?php } ?>
|
||||
|
@ -216,7 +218,7 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
autocomplete="on" autocapitalize="none" autocorrect="off"
|
||||
<?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
|
||||
/>
|
||||
<span class="icon-checkmark hidden"/>
|
||||
<span class="icon-checkmark hidden"></span>
|
||||
<?php if($_['lookupServerUploadEnabled']) { ?>
|
||||
<input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>">
|
||||
<?php } ?>
|
||||
|
@ -261,7 +263,7 @@ vendor_style('jcrop/css/jquery.Jcrop');
|
|||
autocomplete="on" autocapitalize="none" autocorrect="off"
|
||||
<?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
|
||||
/>
|
||||
<span class="icon-checkmark hidden"/>
|
||||
<span class="icon-checkmark hidden"></span>
|
||||
<?php if($_['lookupServerUploadEnabled']) { ?>
|
||||
<input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>">
|
||||
<?php } ?>
|
||||
|
|
Loading…
Reference in a new issue