show Spinner when stuff is being saved

This commit is contained in:
Arthur Schiwon 2014-10-14 17:39:27 +02:00
parent 836f0839e5
commit c26e9c675a
3 changed files with 17 additions and 1 deletions

View File

@ -123,6 +123,14 @@ select[multiple=multiple] + button {
max-width: 40%; max-width: 40%;
} }
#ldap .ldap_saving {
margin-right: 15px;
color: orange;
font-weight: bold;
}
#ldap .ldap_saving img { height: 15px; }
.ldap_config_state_indicator_sign { .ldap_config_state_indicator_sign {
display: inline-block; display: inline-block;
height: 16px; height: 16px;

View File

@ -747,7 +747,10 @@ var LdapWizard = {
} }
}, },
saveProcesses: 0,
_save: function(object, value) { _save: function(object, value) {
$('#ldap .ldap_saving').removeClass('hidden');
LdapWizard.saveProcesses += 1;
param = 'cfgkey='+encodeURIComponent(object.id)+ param = 'cfgkey='+encodeURIComponent(object.id)+
'&cfgval='+encodeURIComponent(value)+ '&cfgval='+encodeURIComponent(value)+
'&action=save'+ '&action=save'+
@ -757,10 +760,14 @@ var LdapWizard = {
OC.filePath('user_ldap','ajax','wizard.php'), OC.filePath('user_ldap','ajax','wizard.php'),
param, param,
function(result) { function(result) {
LdapWizard.saveProcesses -= 1;
if(LdapWizard.saveProcesses === 0) {
$('#ldap .ldap_saving').addClass('hidden');
}
if(result.status === 'success') { if(result.status === 'success') {
LdapWizard.processChanges(object); LdapWizard.processChanges(object);
} else { } else {
// alert('Oooooooooooh :('); console.log('Could not save value for ' + object.id);
} }
} }
); );

View File

@ -1,4 +1,5 @@
<div class="ldapWizardControls"> <div class="ldapWizardControls">
<span class="ldap_saving hidden"><?php p($l->t('Saving'));?> <img class="wizSpinner" src="<?php p(image_path('core', 'loading.gif')); ?>"/></span>
<span class="ldap_config_state_indicator"></span> <span class="ldap_config_state_indicator_sign"></span> <span class="ldap_config_state_indicator"></span> <span class="ldap_config_state_indicator_sign"></span>
<button class="ldap_action_back invisible" name="ldap_action_back" <button class="ldap_action_back invisible" name="ldap_action_back"
type="button"> type="button">