mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 05:30:21 -04:00
Make the UI more performant by not reflowing
Fixes the height of the component until it’s loaded so that it doesn’t causes the page to reflow while it’s rendering the buttons. Stops the options being shown and then immediately hiding on initial page load.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
let states = {
|
||||
'initial': Hogan.compile(`
|
||||
<div class="radio-select-column">
|
||||
<label class="block-label" for="{{name}}-0">
|
||||
<label class="block-label js-block-label" for="{{name}}-0">
|
||||
<input checked="checked" id="{{name}}-0" name="{{name}}" type="radio" value=""> Now
|
||||
</label>
|
||||
</div>
|
||||
@@ -17,13 +17,13 @@
|
||||
`),
|
||||
'choose': Hogan.compile(`
|
||||
<div class="radio-select-column">
|
||||
<label class="block-label" for="{{name}}-0">
|
||||
<label class="block-label js-block-label" for="{{name}}-0">
|
||||
<input checked="checked" id="{{name}}-0" name="{{name}}" type="radio" value="" class="js-initial-option"> Now
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio-select-column">
|
||||
{{#choices}}
|
||||
<label class="block-label" for="{{id}}">
|
||||
<label class="block-label js-block-label" for="{{id}}">
|
||||
<input type="radio" value="{{value}}" id="{{id}}" name="{{name}}" class="js-option" />
|
||||
{{label}}
|
||||
</label>
|
||||
@@ -32,13 +32,13 @@
|
||||
`),
|
||||
'chosen': Hogan.compile(`
|
||||
<div class="radio-select-column">
|
||||
<label class="block-label" for="{{name}}-0">
|
||||
<label class="block-label js-block-label" for="{{name}}-0">
|
||||
<input id="{{name}}-0" name="{{name}}" type="radio" value="" class="js-initial-option"> Now
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio-select-column">
|
||||
{{#choices}}
|
||||
<label class="block-label" for="{{id}}">
|
||||
<label class="block-label js-block-label" for="{{id}}">
|
||||
<input checked="checked" type="radio" value="{{value}}" id="{{id}}" name="{{name}}" />
|
||||
{{label}}
|
||||
</label>
|
||||
@@ -139,6 +139,8 @@
|
||||
'name': name
|
||||
});
|
||||
|
||||
$component.css({'height': 'auto'});
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user