// Setup the url.
$url = $starlineUrl . 'ferrySchedule.php';
$inDropDown = filter_var( $actionData['request']['in_dropdown'], FILTER_VALIDATE_BOOLEAN );
+ $offCanvas = filter_var( $actionData['request']['off_canvas'], FILTER_VALIDATE_BOOLEAN );
$urlParams = array();
- if ( isset( $actionData['request']['in_dropdown'] ) && $inDropDown ) {
+ if ( $inDropDown ) {
$urlParams[] = 'dropdown=1';
}
- if ( isset( $_REQUEST['mapLink'] ) && !$inDropDown ) {
+ if ( $offCanvas ) {
+ $urlParams[] = 'offcanvas=1';
+ }
+ if ( isset( $_REQUEST['mapLink'] ) && !$inDropDown && !$offCanvas ) {
$urlParams[] = 'mapLink=' . $_REQUEST['mapLink'];
}
- if ( isset( $_REQUEST['dockId'] ) && !$inDropDown ) {
+ if ( isset( $_REQUEST['dockId'] ) && !$inDropDown && !$offCanvas ) {
$urlParams[] = 'dockId=' . $_REQUEST['dockId'];
}
- if ( isset( $_REQUEST['scheduleId'] ) && !$inDropDown ) {
+ if ( isset( $_REQUEST['scheduleId'] ) && !$inDropDown && !$offCanvas ) {
$urlParams[] = 'scheduleId=' . $_REQUEST['scheduleId'];
}
if ( !empty( $urlParams ) ) {
'mainSchedId' => $mainSchedId,
'content' => $content,
'inDropDown' => $inDropDown,
+ 'offCanvas' => $offCanvas,
'schedulePage' => get_home_url(null, '/' ) . $starlinePageSlug . '/',
);
return false;
});
{/if}
+ {if $offCanvas}
+ // For the drop down docks schedules
+ var offcanvas_dockForm = $("#oc_dockForm");
+ var offcanvas_formDockId = $("#oc_formDockId");
+ var offcanvas_formSchedId = $("#oc_formSchedId");
+ var offcanvas_dock1Sel = $('#oc-sched-1');
+ offcanvas_dock1Sel.change(function(){
+ offcanvas_formSchedId.val(1);
+ offcanvas_formDockId.val(offcanvas_dock1Sel.val());
+ offcanvas_dockForm.submit();
+ });
+ var offcanvas_dock2Sel = $('#oc-sched-2');
+ offcanvas_dock2Sel.change(function(){
+ offcanvas_formSchedId.val(2);
+ offcanvas_formDockId.val(offcanvas_dock2Sel.val());
+ offcanvas_dockForm.submit();
+ });
+ var offcanvas_dock3Sel = $('#oc-sched-3');
+ offcanvas_dock3Sel.change(function(){
+ offcanvas_formSchedId.val(3);
+ offcanvas_formDockId.val(offcanvas_dock3Sel.val());
+ offcanvas_dockForm.submit();
+ });
+ var offcanvas_dock4Sel = $('#oc-sched-4');
+ offcanvas_dock4Sel.change(function(){
+ offcanvas_formSchedId.val(4);
+ offcanvas_formDockId.val(offcanvas_dock4Sel.val());
+ offcanvas_dockForm.submit();
+ });
+ var offcanvas_mapLink1 = $('#offcanvas-google-map-link1');
+ offcanvas_mapLink1.click(function(){
+ window.location = '{$schedulePage}/?mapLink=1';
+ return false;
+ });
+ var offcanvas_mapLink2 = $('#offcanvas-google-map-link2');
+ offcanvas_mapLink2.click(function(){
+ window.location = '{$schedulePage}/?mapLink=2';
+ return false;
+ });
+ var offcanvas_mapLink3 = $('#offcanvas-google-map-link3');
+ offcanvas_mapLink3.click(function(){
+ window.location = '{$schedulePage}/?mapLink=3';
+ return false;
+ });
+ var offcanvas_mapLink4 = $('#offcanvas-google-map-link4');
+ offcanvas_mapLink4.click(function(){
+ window.location = '{$schedulePage}/?mapLink=4';
+ return false;
+ });
+ {/if}
});
</script>
method="get">
<input type="hidden" id="formDockId" name="dockId">
<input type="hidden" id="formSchedId" name="scheduleId">
+{else if $offCanvas}
+ <div id="oc_schedule_wrapper" class="common_schedule_wrapper">
+ <form
+ id="oc_dockForm"
+ name="oc_dockForm"
+ action="{$schedulePage}"
+ method="get">
+ <input type="hidden" id="oc_formDockId" name="dockId">
+ <input type="hidden" id="oc_formSchedId" name="scheduleId">
{else}
<div id="inside_schedule_wrapper" class="common_schedule_wrapper">
{/if}
- {$content}
- {if $inDropDown}
- </form>
- {/if}
+{$content}
+{if $inDropDown}
+ </form>
+{/if}
</div>