Skip to content

Commit

Permalink
Improve the hint API, add inset mode to loader
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Jul 24, 2015
1 parent 4781c70 commit d453f92
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
4 changes: 3 additions & 1 deletion modules/backend/assets/css/october.css
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,8 @@ html.cssanimations .loading-indicator.size-small > span,html.cssanimations .load
.loading-indicator.indicator-center,.loading-indicator-container.indicator-center .loading-indicator{padding:20px}
.loading-indicator.indicator-center > span,.loading-indicator-container.indicator-center .loading-indicator > span{left:50%;margin-left:-20px;margin-top:-20px}
.loading-indicator.indicator-center > div,.loading-indicator-container.indicator-center .loading-indicator > div{top:auto;text-align:center;position:relative}
.loading-indicator.indicator-inset,.loading-indicator-container.indicator-inset .loading-indicator{padding-left:80px}
.loading-indicator.indicator-inset > span,.loading-indicator-container.indicator-inset .loading-indicator > span{left:20px}
.loading-indicator-container.size-form-field .loading-indicator,.loading-indicator-container.size-input-text .loading-indicator{background-color:transparent;padding:0;margin:0}
.loading-indicator-container.size-form-field .loading-indicator > span,.loading-indicator-container.size-input-text .loading-indicator > span{padding:0;margin:0;left:auto;right:7px;top:6px;width:23px;height:23px;background-size:23px 23px}
.loading-indicator-container.size-form-field .loading-indicator > span{top:0;right:0;width:20px;height:20px;background-size:20px 20px}
Expand Down Expand Up @@ -3366,4 +3368,4 @@ html.cssanimations .fancy-layout .form-tabless-fields .loading-indicator-contain
.flyout-toggle i{margin:7px 0 0 6px;display:inline-block}
.flyout-toggle:hover i{color:#ffffff}
body.flyout-visible{overflow:hidden}
body.flyout-visible .flyout-overlay{background-color:rgba(0,0,0,0.3)}
body.flyout-visible .flyout-overlay{background-color:rgba(0,0,0,0.3)}
9 changes: 7 additions & 2 deletions modules/backend/classes/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,15 @@ public function handleError($exception)
* @param array $params Extra parameters
* @return string
*/
public function makeHintPartial($name, $partial = null, array $params = [])
public function makeHintPartial($name, $partial = null, $params = [])
{
if (is_array($partial)) {
$params = $partial;
$partial = null;
}

if (!$partial) {
$partial = $name;
$partial = array_get($params, 'partial', $name);
}

return $this->makeLayoutPartial('hint', [
Expand Down
13 changes: 9 additions & 4 deletions modules/backend/layouts/_hint.htm
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php
$type = !empty($type) ? $type : 'info';
?>
<?php if (empty($hintName) || !$this->isBackendHintHidden($hintName)): ?>
<div class="callout callout-<?= $type ?> fade in <?=empty($icon)?'no-icon':''?> <?=empty($subtitle)?'no-subheader':''?>">
<?php
$type = !empty($type) ? $type : 'info';
$cssClasses = ['callout fade in'];
$cssClasses[] = 'callout-'.$type;
if (empty($icon)) $cssClasses[] = 'no-icon';
if (empty($subtitle)) $cssClasses[] = 'no-subheader';
if (!empty($cssClass)) $cssClasses[] = $cssClass;
?>
<div class="<?= implode(' ', $cssClasses) ?>">
<?php if (!empty($hintName)): ?>
<button
type="button"
Expand Down
7 changes: 7 additions & 0 deletions modules/system/assets/ui/docs/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ A loading indicator can be aligned to the center by adding `indicator-center` to
</div>
</div>

<div class="loading-indicator-container">
<div class="loading-indicator indicator-inset">
<span></span>
<div>Loading (inset)</div>
</div>
</div>

<div class="loading-indicator-container">
<div class="loading-indicator size-small">
<span></span>
Expand Down
10 changes: 10 additions & 0 deletions modules/system/assets/ui/less/loader.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ html.cssanimations {
}
}

// Inset

.loading-indicator.indicator-inset,
.loading-indicator-container.indicator-inset .loading-indicator {
padding-left: 80px;

> span {
left: 20px;
}
}

// Form fields

Expand Down

0 comments on commit d453f92

Please sign in to comment.