Scrims

A scrim is used to temporarily disable an application's user interface. It covers the screen with a translucent layer.

Scrim

It's possible to create a scrim in a components block, but this usage is not common. Typically, a scrim is shown using enyo.scrim.show().

To show a scrim for five seconds:

buttonClick: function() {
  enyo.scrim.show();
  setTimeout(enyo.scrim.hide, 5000);
}

To show a scrim while a service is in flight:

components: [
  {kind: "PalmService", onResponse: "serviceResponse"},
  {kind: "Button", caption: "Call Service", onclick: "buttonClick"}
],
buttonClick: function() {
  this.$.service.call();
  enyo.scrim.show();
},
serviceResponse: function() {
  enyo.scrim.hide();
}

To show a scrim and then hide it when the user clicks on it:

components: [
  {kind: "Button", caption: "Show scrim", onclick: "buttonClick"},
  {kind: "Scrim", onclick: "scrimClick"}
],
buttonClick: function() {
  this.$.scrim.show();
},
scrimClick: function() {
  this.$.scrim.hide();
}