From: Anthony Talarico Date: Wed, 22 Aug 2018 17:59:21 +0000 (-0400) Subject: testing off canvas functionality for staffords location menus X-Git-Tag: v1.0.52^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=13ef347dda1aa3de4979f955e357a685e6141a00;p=WP-Themes%2Fstaffords.git testing off canvas functionality for staffords location menus --- diff --git a/footer.php b/footer.php index b919f04..9af7708 100644 --- a/footer.php +++ b/footer.php @@ -59,7 +59,27 @@ - + "Stafford's Bay View Inn", + 188 => "Stafford's Crooked River Lodge", + 189 => "Stafford's Perry Hotel", + 190 => "Stafford's Pier Restaurant", + 191 => "Stafford's Weathervayne Restaurant", + 192 => "Stafford's Noggin Room Pub", + 230 => "Stafford's Pointer Boat", + 197 => "Stafford's Vacation Rentals", + 194 => "Stafford's Wedding Specials" + ); + ?> + diff --git a/functions.php b/functions.php index 130fd88..d039e47 100644 --- a/functions.php +++ b/functions.php @@ -152,6 +152,23 @@ function is_tree( $pid ) { } return false; } +function isProperty($page_id, $props_array, $deep = false){ + $post = get_post($page_id); + $is_property = false; + + foreach($props_array as $id=>$property){ + if( $deep ){ + if( is_page($id) || $id == $post->post_parent || is_tree($id) ){ + $is_property = true; + } + }else{ + if( is_page($id) ){ + $is_property = true; + } + } + } + return $is_property; +} function setReservationWidgetProperty($page_id, $props_array){ $post = get_post($page_id); $property_name = ''; diff --git a/js/app.js b/js/app.js index c338a90..d9c7397 100644 --- a/js/app.js +++ b/js/app.js @@ -27,6 +27,11 @@ $(document).ready(function () { $("#res-tab-open").attr("id", "res-tab"); } }); + if(window.glmData.location){ + console.log( $('a.toggle')) + $('a.toggle').trigger("click"); + $('.off-canvas-wrap').foundation('offcanvas', 'show', 'move-right'); + } var extraDay,currentDate, currentDate2, requiredDate,minDays, departure, stay, d, dd, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&', crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&', adults, @@ -83,54 +88,6 @@ $(document).ready(function () { $("#nightsOff").val( 1 ) stay = `stay_nights=1&`; } - - - // currentDate = $("#arriveOff").val(); - // currentDate = new Date(currentDate); - // console.log(currentDate); - // currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate()); - // currentDate.setDate(currentDate.getDate()); - // dd = currentDate.getDate() + 1; - // if (dd <= 9) { - // dd = '0' + dd; - // } - // d = currentDate.getDate(); - // if (d <= 9) { - // d = '0' + d; - // } - // m = currentDate.getMonth() + 1; - // if (m <= 9) { - // m = '0' + m; - // } - // y = currentDate.getFullYear(); - - // // this variable is for passing to booking site - // start = "arrival_date=" + y + '-' + m + '-' + d + '&'; - - // requiredDate = y + '-' + m + '-' + d; - // minDays = y + '-' + m + '-' + dd; - // console.log(minDays); - - // $("#departOff").attr("min", minDays).val(minDays); - // if( !$("#departOff").val() <= 1 ){ - // $("#departOff").val(minDays); - // } - // if (requiredDate < $("#arriveOff").attr("min")) { - // minDays = $("#arriveOff").attr("min"); - // $("#arriveOff").val(minDays); - // } - // $("#nightsOff").val( $("#departOff").val() - $("#arriveOff".val())) - - // if ($("#departOff").val() === "Departure Date" || $("#departOff").val() === "") { - // $("#nightsOff").val(""); - // } else { - // $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); - // } - - // if ($("#nightsOff").val() <= 0) { - // // $("#departOff").val("Minimum 1 Night"); - // $("#nightsOff").val(""); - // } }); // // restrict departure date /////////////////////////////// $(document).on('change', '#departOff', function () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 26cb735..399bdda 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -18,6 +18,11 @@ $(document).ready(function () { $("#res-tab-open").attr("id", "res-tab"); } }); + if(window.glmData.location){ + console.log( $('a.toggle')) + $('a.toggle').trigger("click"); + $('.off-canvas-wrap').foundation('offcanvas', 'show', 'move-right'); + } var extraDay,currentDate, currentDate2, requiredDate,minDays, departure, stay, d, dd, m, y, bayView = 'vD4ZpIFk4%2b7FyPsaBnkCqP1cBHWnJili9k5D83MqJq4%3d&', crookedRiver = 'ZhWXD46i2%2fq319vcR%2fcw69rZvA2bz%2fttOOxO9t1%2fBJ0%3d&', adults, @@ -74,54 +79,6 @@ $(document).ready(function () { $("#nightsOff").val( 1 ) stay = `stay_nights=1&`; } - - - // currentDate = $("#arriveOff").val(); - // currentDate = new Date(currentDate); - // console.log(currentDate); - // currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate()); - // currentDate.setDate(currentDate.getDate()); - // dd = currentDate.getDate() + 1; - // if (dd <= 9) { - // dd = '0' + dd; - // } - // d = currentDate.getDate(); - // if (d <= 9) { - // d = '0' + d; - // } - // m = currentDate.getMonth() + 1; - // if (m <= 9) { - // m = '0' + m; - // } - // y = currentDate.getFullYear(); - - // // this variable is for passing to booking site - // start = "arrival_date=" + y + '-' + m + '-' + d + '&'; - - // requiredDate = y + '-' + m + '-' + d; - // minDays = y + '-' + m + '-' + dd; - // console.log(minDays); - - // $("#departOff").attr("min", minDays).val(minDays); - // if( !$("#departOff").val() <= 1 ){ - // $("#departOff").val(minDays); - // } - // if (requiredDate < $("#arriveOff").attr("min")) { - // minDays = $("#arriveOff").attr("min"); - // $("#arriveOff").val(minDays); - // } - // $("#nightsOff").val( $("#departOff").val() - $("#arriveOff".val())) - - // if ($("#departOff").val() === "Departure Date" || $("#departOff").val() === "") { - // $("#nightsOff").val(""); - // } else { - // $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24)); - // } - - // if ($("#nightsOff").val() <= 0) { - // // $("#departOff").val("Minimum 1 Night"); - // $("#nightsOff").val(""); - // } }); // // restrict departure date /////////////////////////////// $(document).on('change', '#departOff', function () {