diff --git a/js/Popup.js b/js/Popup.js index 5d6550a..a3727f9 100644 --- a/js/Popup.js +++ b/js/Popup.js @@ -1,11 +1,11 @@ function showPopup(popup) { - $("#popupMask").fadeIn(POPUP_SHOW_DURATION); + popupMask.fadeIn(POPUP_SHOW_DURATION); popup.fadeIn(POPUP_SHOW_DURATION); keyboardShortcutsEnabled=false; } function hidePopup(popup) { - $("#popupMask").fadeOut(POPUP_SHOW_DURATION); + popupMask.fadeOut(POPUP_SHOW_DURATION); popup.fadeOut(POPUP_SHOW_DURATION); keyboardShortcutsEnabled=true; } \ No newline at end of file diff --git a/js/WordArt.js b/js/WordArt.js index cbf4b02..f449951 100644 --- a/js/WordArt.js +++ b/js/WordArt.js @@ -8,13 +8,13 @@ function initWordArt() { function showWordArtDialog() { buttonGroupAdd.hide(); showPopup(popupWordArt); - $("#popupMask").bind("click", onWordArtCancel); + popupMask.bind("onButtonClick", onWordArtCancel); $("#txtWordArt").focus(); $("#txtWordArt").val(""); //clear textbox } function onWordArtCancel() { - $("#popupMask").unbind("click"); + popupMask.unbind("onButtonClick"); hidePopup(popupWordArt); } diff --git a/js/buttonbehaviors.js b/js/buttonbehaviors.js index eb9d01b..4b285c6 100644 --- a/js/buttonbehaviors.js +++ b/js/buttonbehaviors.js @@ -48,7 +48,9 @@ function initButtonBehavior() { buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes"); popupWordArt = $("#popupWordArt"); popupShape = $("#popupShape"); + popupMask = $("#popupMask"); + popupMask.Button(); btnNew.on("onButtonClick", onBtnNew); btnAdd.on("onButtonClick", onBtnAdd); btnWordArt.on("onButtonClick", onBtnWordArt);