0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 17:27:57 +01:00

Turning popupMask in a Button

This commit is contained in:
peteruithoven 2014-01-16 12:04:55 +01:00
parent a952a1ee7b
commit fc8c83ae19
3 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,11 @@
function showPopup(popup) { function showPopup(popup) {
$("#popupMask").fadeIn(POPUP_SHOW_DURATION); popupMask.fadeIn(POPUP_SHOW_DURATION);
popup.fadeIn(POPUP_SHOW_DURATION); popup.fadeIn(POPUP_SHOW_DURATION);
keyboardShortcutsEnabled=false; keyboardShortcutsEnabled=false;
} }
function hidePopup(popup) { function hidePopup(popup) {
$("#popupMask").fadeOut(POPUP_SHOW_DURATION); popupMask.fadeOut(POPUP_SHOW_DURATION);
popup.fadeOut(POPUP_SHOW_DURATION); popup.fadeOut(POPUP_SHOW_DURATION);
keyboardShortcutsEnabled=true; keyboardShortcutsEnabled=true;
} }

View File

@ -8,13 +8,13 @@ function initWordArt() {
function showWordArtDialog() { function showWordArtDialog() {
buttonGroupAdd.hide(); buttonGroupAdd.hide();
showPopup(popupWordArt); showPopup(popupWordArt);
$("#popupMask").bind("click", onWordArtCancel); popupMask.bind("onButtonClick", onWordArtCancel);
$("#txtWordArt").focus(); $("#txtWordArt").focus();
$("#txtWordArt").val(""); //clear textbox $("#txtWordArt").val(""); //clear textbox
} }
function onWordArtCancel() { function onWordArtCancel() {
$("#popupMask").unbind("click"); popupMask.unbind("onButtonClick");
hidePopup(popupWordArt); hidePopup(popupWordArt);
} }

View File

@ -48,7 +48,9 @@ function initButtonBehavior() {
buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes"); buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes");
popupWordArt = $("#popupWordArt"); popupWordArt = $("#popupWordArt");
popupShape = $("#popupShape"); popupShape = $("#popupShape");
popupMask = $("#popupMask");
popupMask.Button();
btnNew.on("onButtonClick", onBtnNew); btnNew.on("onButtonClick", onBtnNew);
btnAdd.on("onButtonClick", onBtnAdd); btnAdd.on("onButtonClick", onBtnAdd);
btnWordArt.on("onButtonClick", onBtnWordArt); btnWordArt.on("onButtonClick", onBtnWordArt);