|
62 | 62 | overla yEvents.addCloseHandler(closeEvent -> MaterialToast.fireToast("Overlay Closed")); |
63 | 63 | </demo:PrettyPre> |
64 | 64 | </m:MaterialRow> |
| 65 | + |
| 66 | + <m:MaterialRow addStyleNames="code"> |
| 67 | + <m:MaterialTitle title="Nested Overlays" description="You can provide multiple child overlay in order to create a modal-like structure."/> |
| 68 | + |
| 69 | + <!-- Parent 1 --> |
| 70 | + <ma:overlay.MaterialOverlay ui:field="overlayParent" overflow="AUTO" backgroundColor="BLUE" textAlign="CENTER" textColor="WHITE" depth="999"> |
| 71 | + <m:MaterialLabel textAlign="CENTER" text="This is an overlay" marginTop="120" fontWeight="LIGHTER" fontSize="2em" /> |
| 72 | + <m:MaterialLabel textAlign="CENTER" text="Some content goes here" marginBottom="40" /> |
| 73 | + <m:MaterialButton ui:field="btnOpenChild" text="Open Overlay" /> |
| 74 | + <m:MaterialButton ui:field="btnCloseParent" text="Close Overlay" /> |
| 75 | + </ma:overlay.MaterialOverlay> |
| 76 | + <m:MaterialButton ui:field="btnOpenParent" text="Open Overlay" /> |
| 77 | + |
| 78 | + <!-- Child 1 --> |
| 79 | + <ma:overlay.MaterialOverlay ui:field="overlayChild" overflow="AUTO" backgroundColor="INDIGO" relativeToWindow="true" textAlign="CENTER" depth="999" textColor="WHITE"> |
| 80 | + <m:MaterialLabel textAlign="CENTER" text="This is a child overlay" marginTop="120" fontWeight="LIGHTER" fontSize="2em" /> |
| 81 | + <m:MaterialLabel textAlign="CENTER" text="Some content goes here" marginBottom="40" /> |
| 82 | + <m:MaterialButton ui:field="btnOpenChild2" backgroundColor="INDIGO_ACCENT_1" text="Open Child" /> |
| 83 | + <m:MaterialButton ui:field="btnCloseChild" backgroundColor="INDIGO_ACCENT_1" text="Close Overlay" /> |
| 84 | + |
| 85 | + <!-- Child 2 --> |
| 86 | + <ma:overlay.MaterialOverlay ui:field="overlayChild2" overflow="AUTO" relativeToWindow="true" backgroundColor="PINK" textAlign="CENTER" depth="999" textColor="WHITE"> |
| 87 | + <m:MaterialLabel textAlign="CENTER" text="This is a Second child overlay" marginTop="120" fontWeight="LIGHTER" fontSize="2em" /> |
| 88 | + <m:MaterialLabel textAlign="CENTER" text="Some content goes here" marginBottom="40" /> |
| 89 | + <m:MaterialButton ui:field="btnCloseChild2" backgroundColor="PINK_ACCENT_1" text="Close Overlay" /> |
| 90 | + </ma:overlay.MaterialOverlay> |
| 91 | + </ma:overlay.MaterialOverlay> |
| 92 | + |
| 93 | + <demo:PrettyPre addStyleNames="lang-java"> |
| 94 | +  <!-- Parent --><br/> |
| 95 | + <ma:overlay.MaterialOverlay ui:field="parent"><br/><br/> |
| 96 | + |
| 97 | +  <!-- Child 1 --><br/> |
| 98 | +  <ma:overlay.MaterialOverlay ui:field="child1"><br/><br/> |
| 99 | + |
| 100 | +   <!-- Child 2 --><br/> |
| 101 | +   <ma:overlay.MaterialOverlay ui:field="child2"/><br/> |
| 102 | +  </ma:overlay.MaterialOverlay><br/> |
| 103 | + </ma:overlay.MaterialOverlay> |
| 104 | + </demo:PrettyPre> |
| 105 | + </m:MaterialRow> |
65 | 106 | </g:HTMLPanel> |
66 | 107 | </ui:UiBinder> |
0 commit comments