function getRelativeParent()

in src/main/resources/libs/esx/esx_modules/url/index.js [45:55]


 function getRelativeParent(path, level) {
     var idx = path.length;
     while (level > 0) {
             idx = path.lastIndexOf('/', idx - 1);
            if (idx < 0) {
                     return "";
                 }
             level--;
         }
     return (idx == 0) ? "/" : path.substring(0, idx);
 }