From fc8c83ae19a16ada302f1485d50c2bc569eab2f6 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 16 Jan 2014 12:04:55 +0100 Subject: [PATCH] Turning popupMask in a Button --- js/Popup.js | 4 ++-- js/WordArt.js | 4 ++-- js/buttonbehaviors.js | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) 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);