semantic-ui-riot
Version:
Semantic UI for Riot
56 lines (47 loc) • 1.58 kB
JavaScript
// ===================================================================================
// Lifecycle
// =========
// eslint-disable-next-line no-unused-vars
function onMounted(props, state) {
if (this.obs) {
this.obs.on('su-loading', visible => {
suLoading(this, visible);
});
}
}
// ===================================================================================
// Logic
// =====
function suLoading(tag, visible) {
if (visible) {
tag.counter++;
} else {
tag.counter--;
}
tag.update();
}
var suLoading$1 = {
'css': `su-loading .ui.dimmer,[is="su-loading"] .ui.dimmer{ z-index: 20000 }`,
'exports': {
counter: 0,
onMounted
},
'template': function(template, expressionTypes, bindingTypes, getComponent) {
return template(
'<div expr30="expr30"><div class="ui huge text loader">Loading</div></div>',
[{
'redundantAttribute': 'expr30',
'selector': '[expr30]',
'expressions': [{
'type': expressionTypes.ATTRIBUTE,
'name': 'class',
'evaluate': function(scope) {
return ['ui page dimmer inverted ', scope.counter > 0 ? 'active' : ''].join('');
}
}]
}]
);
},
'name': 'su-loading'
};
export default suLoading$1;