diff --git a/assets/pages/jquery.drawConnections.js b/assets/pages/jquery.drawConnections.js index 011eece..2867519 100755 --- a/assets/pages/jquery.drawConnections.js +++ b/assets/pages/jquery.drawConnections.js @@ -584,6 +584,7 @@ function makeCabCloseClickable(){ function resizePathCanvas() { $.each(pathArray, function(pathName, path){ + var canvas = path['canvas']; $(canvas).attr('width', $(canvas).parent().width()); $(canvas).attr('height', $(canvas).parent().height()); @@ -627,10 +628,10 @@ function initializeCanvas() { // Path connections pathArray = {}; if($('#canvasPath').length) { - canvasPath = document.getElementById('canvasPath'); + var canvas = $('#canvasPath'); pathArray['path'] = { - 'context': canvasPath.getContext('2d'), - 'canvas': $('#canvasPath'), + 'context': $(canvas)[0].getContext('2d'), + 'canvas': canvas, 'container' : $('#containerFullPath'), 'connections': {}, 'trunks': {} @@ -638,3 +639,14 @@ function initializeCanvas() { } } + +function initializeCanvasPathFinder(container) { + var canvas = $('#canvasPathFinder'); + pathArray['pathFinder'] = { + 'context': $(canvas)[0].getContext('2d'), + 'canvas': canvas, + 'container' : container, + 'connections': {}, + 'trunks': {} + }; +} \ No newline at end of file diff --git a/assets/pages/jquery.explore.js b/assets/pages/jquery.explore.js index 7ff7a88..9afc838 100755 --- a/assets/pages/jquery.explore.js +++ b/assets/pages/jquery.explore.js @@ -57,12 +57,13 @@ function clearSelectionDetails(){ } function makeRackObjectsClickable(){ - $('.port').click(function(event){ + $('.port').click(function(event){ + $(document).data('portClickedFlag', true); var portIndex = $(this).data('portIndex'); - //Store PortID + //Store PortID $(document).data('clickedObjPortID', portIndex); }); @@ -74,7 +75,13 @@ function makeRackObjectsClickable(){ if ($(document).data('portClickedFlag') === false) { if ($(this).data('partitionType') == 'Connectable') { + + // Default port selection $(document).data('clickedObjPortID', 0); + + // Draw cabinet connection path + $(document).data('selectedPort', $(this).find('.port').first()); + drawCabinet(); } else { $(document).data('clickedObjPortID', null); } @@ -717,10 +724,9 @@ $( document ).ready(function() { $('#printPathFinder ').on('click', function(event){ event.preventDefault(); - $('#containerCablePath').printThis({ - importStyle: true, - removeInline: true, - removeInlineSelector: "img" + $('#containerCablePath').parent().printThis({ + canvas: true, + importStyle: true }); }); @@ -873,6 +879,9 @@ $( document ).ready(function() { }); }); + // Clear path connections + drawPath(); + var table = ''; var pathID = 0; $.each(responseJSON.success, function(pathType, pathTypeArray){ @@ -906,12 +915,19 @@ $( document ).ready(function() { if($(this).hasClass('tableRowHighlight')) { $(this).removeClass('tableRowHighlight'); $('.containerCablePath').hide(); + + // Clear path connections + drawPath(); } else { pathTable.$('tr.tableRowHighlight').removeClass('tableRowHighlight'); $(this).addClass('tableRowHighlight'); var pathIndex = $(this).attr('data-pathid'); $('.containerCablePath').hide(); $('#containerCablePath'+pathIndex).show(); + + // Draw path connections + initializeCanvasPathFinder($('#containerCablePath'+pathIndex)); + drawPath(); } }); diff --git a/explore.php b/explore.php index 5d9ff86..b51db09 100755 --- a/explore.php +++ b/explore.php @@ -304,7 +304,7 @@ $qls->Security->check_auth_page('user.php');
- +
diff --git a/includes/header_end.php b/includes/header_end.php index 22c2e11..0a6b34b 100755 --- a/includes/header_end.php +++ b/includes/header_end.php @@ -18,7 +18,7 @@ - + diff --git a/includes/modals.php b/includes/modals.php index d938e8f..59f581d 100755 --- a/includes/modals.php +++ b/includes/modals.php @@ -161,6 +161,7 @@
+