Browse Source

fixed js bug in safari - fun default arguments

Piotr Labudda 8 years ago
parent
commit
6b13a657f5
1 changed files with 10 additions and 4 deletions
  1. 10 4
      SE/static/procesEditor.js

+ 10 - 4
SE/static/procesEditor.js

@@ -77,7 +77,11 @@ $(document).ready(function() {
         }
     });
 
-    function showPath(parent, target = $(".path"), showEdit = true, renderTree = false) {
+    function showPath(parent, target, hideEdit, renderTree) {
+		var target =  target || $(".path")
+		var hideEdit = hideEdit || false
+		var showEdit = ! hideEdit
+		var renderTree = renderTree || false
 
         var link = BASE_URL + "index.php?_route=UrlAction_ProcesEditor&_task=getPathAjax&id=" + parent;
         $.get(link, function(data) {
@@ -502,7 +506,7 @@ $(document).ready(function() {
       var target = $(this).closest(".p5bModalModal")
       //pathModal(target);
       //showPath(state[0]["parent_id"]);
-      showPath(state[0]["parent_id"], ".pathPreview", false, true);
+      showPath(state[0]["parent_id"], ".pathPreview", true, true);
 
 
     })
@@ -553,7 +557,7 @@ $(document).ready(function() {
         + "<button type='button' class='btn btn-default p5BModalButton' id='previousPath'>Anuluj</button>"
         + "");
         $("#pathList").data("previous", state[0]["parent_id"])
-        showPath(state[0]["parent_id"], ".pathPreview", false, true);
+        showPath(state[0]["parent_id"], ".pathPreview", true, true);
 
     }
 
@@ -2217,7 +2221,9 @@ $(document).ready(function() {
         return result;
     }
 
-    function getIndexById(id, arr = state, label = "id") {
+    function getIndexById(id, arr, label) {
+		var arr = arr || state
+		var label = label || "id"
         var result = arr.length - 1;
         if (label == "ID")
             result = -1;