Skip to content

Commit a73ca30

Browse files
author
svuillet
committed
snackbar confirmation is modal
1 parent 675256a commit a73ca30

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

mobile-war/src/main/java/org/silverpeas/mobile/client/components/Snackbar.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.google.gwt.user.client.Command;
99
import com.google.gwt.user.client.Timer;
1010
import com.google.gwt.user.client.ui.Anchor;
11+
import org.silverpeas.mobile.client.SpMobil;
1112
import org.silverpeas.mobile.client.resources.ApplicationMessages;
1213

1314
public class Snackbar {
@@ -43,6 +44,7 @@ public void run() {
4344
}
4445
};
4546
timer.schedule(delay);
47+
SpMobil.getMainPage().unfreeze();
4648
}
4749

4850
public static void showWithCloseButton(String message, int type) {
@@ -73,6 +75,7 @@ public static void showConfirmation(String message, Command yesCommand, Command
7375
}
7476

7577
public static void showConfirmation(String message, String yesLabel, String noLabel, Command yesCommand, Command noCommand) {
78+
SpMobil.getMainPage().freeze();
7679
BodyElement body = Document.get().getBody();
7780
DivElement div = Document.get().createDivElement();
7881
div.setAttribute("id","snackbar");

mobile-war/src/main/java/org/silverpeas/mobile/client/components/base/Page.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,12 @@ public boolean isPersonalAppsInitialized() {
163163
return menu.isPersonalAppsInitialized();
164164
}
165165

166+
public void freeze() {
167+
container.getElement().addClassName("freeze");
168+
}
169+
170+
public void unfreeze() {
171+
container.getElement().removeClassName("freeze");
172+
}
173+
166174
}

mobile-war/src/main/java/org/silverpeas/mobile/public/spmobile.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ legend, .ui-input-text input, .ui-input-search input {
7070
font-size: 1.2em;
7171
}
7272

73+
.freeze {
74+
pointer-events: none;
75+
user-select: none;
76+
}
77+
7378
/* Separators
7479
-----------------------------------------------------------------------------------------------------------*/
7580
/* Field contain separator (< 28em) */

0 commit comments

Comments
 (0)