Skip to content

Commit

Permalink
CSS: Re-add spinner for autosubmit
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Sep 30, 2015
1 parent b6ac7f0 commit 51d6c61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library/Icinga/Web/Form/Decorator/Autosubmit.php
Expand Up @@ -100,7 +100,7 @@ public function render($content = '')
: t('Upon its value has changed, this field issues an automatic update of this page.');
$content .= $this->getView()->icon('cw', $warning, array(
'aria-hidden' => $isForm ? 'false' : 'true',
'class' => 'autosubmit-warning'
'class' => 'spinner'
));
if (! $isForm && $this->getAccessible()) {
$content = '<span id="' . $this->getWarningId() . '" class="sr-only">' . $warning . '</span>' . $content;
Expand Down
4 changes: 3 additions & 1 deletion public/css/icinga/spinner.less
@@ -1,11 +1,13 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

a.spinner.active > i,
button.spinner.active > i {
button.spinner.active > i,
i.spinner.active {
.animate(spin 2s infinite linear);
&:before {
// icon-spin6
content: '\e874';
margin: 0; // Disables wobbling
}
}

Expand Down
6 changes: 3 additions & 3 deletions public/js/icinga/events.js
Expand Up @@ -334,8 +334,8 @@
$form.find(':input:not(#search):not(:disabled)').prop('disabled', true);

// Show a spinner depending on how the form is being submitted
if (autosubmit && typeof $el !== 'undefined' && $el.next().hasClass('autosubmit-warning')) {
$el.next().addClass('spinning');
if (autosubmit && typeof $el !== 'undefined' && $el.next().hasClass('spinner')) {
$el.next().addClass('active');
} else if ($button.length && $button.is('button') && $button.hasClass('animated')) {
$button.addClass('active');
} else if ($button.length && $button.attr('data-progress-label')) {
Expand Down Expand Up @@ -376,7 +376,7 @@
if ($progressElement.hasClass('spinner')) {
$('i', $progressElement).addClass('active');
} else {
$('i.autosubmit-warning', $progressElement).addClass('spinning');
$('i.spinner', $progressElement).addClass('active');
}
}
}
Expand Down

0 comments on commit 51d6c61

Please sign in to comment.