Commit 5cdcb1fa11c6450702a5662f12addc87491eb177
1 parent
fa94dc27
Merged from trunk...
KTS-1766 "help pages broken in IE" Fixed. Attempt to strip the domain from the element url if it has been included. Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.3.3-Release-Branch@6363 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
22 additions
and
2 deletions
resources/js/help.js
| 1 | 1 | var curloc = null, |
| 2 | 2 | path_info = null, |
| 3 | - back_key = null; | |
| 3 | + back_key = null, | |
| 4 | + curloc_path = null; | |
| 4 | 5 | |
| 5 | 6 | function correctLink(attr, elm) { |
| 6 | 7 | if(elm.className.search('externalLink') == -1) { |
| 7 | - elm[attr] = curloc + '?' + queryString({'kt_path_info' : path_info + elm.getAttribute(attr), | |
| 8 | + | |
| 9 | + elem_info = unescape(elm.getAttribute(attr)); | |
| 10 | + | |
| 11 | + if (elem_info.indexOf(cur_loc_path) >= 0) | |
| 12 | + { | |
| 13 | + elem_info=elem_info.substring(cur_loc_path.length); | |
| 14 | + } | |
| 15 | + | |
| 16 | + elm[attr] = curloc + '?' + queryString({'kt_path_info' : path_info + elem_info, | |
| 8 | 17 | 'back_key' : back_key }); |
| 9 | 18 | } |
| 10 | 19 | } |
| ... | ... | @@ -12,6 +21,8 @@ function correctLink(attr, elm) { |
| 12 | 21 | |
| 13 | 22 | |
| 14 | 23 | addLoadEvent(function(){ |
| 24 | + | |
| 25 | + | |
| 15 | 26 | var query = window.location.toString().split('?'); |
| 16 | 27 | |
| 17 | 28 | // location of the help.php |
| ... | ... | @@ -20,6 +31,7 @@ addLoadEvent(function(){ |
| 20 | 31 | // get kt_path_info out of the query |
| 21 | 32 | query = parseQueryString(query[1]); |
| 22 | 33 | |
| 34 | + | |
| 23 | 35 | path_info = query.kt_path_info.split('/'); |
| 24 | 36 | path_info.pop(); |
| 25 | 37 | |
| ... | ... | @@ -36,6 +48,14 @@ addLoadEvent(function(){ |
| 36 | 48 | } |
| 37 | 49 | |
| 38 | 50 | path_info = newpath.join('/') + '/'; |
| 51 | + | |
| 52 | + cur_loc_path = ''; | |
| 53 | + cur_loc_tmp = curloc.split('/'); | |
| 54 | + for(i=0;i<cur_loc_tmp.length-1;i++) | |
| 55 | + { | |
| 56 | + | |
| 57 | + cur_loc_path += cur_loc_tmp[i] + '/'; | |
| 58 | + } | |
| 39 | 59 | |
| 40 | 60 | forEach(getElementsByTagAndClassName('A', null, 'kt_help_body'), partial(correctLink, 'href')); |
| 41 | 61 | forEach(getElementsByTagAndClassName('IMG', null, 'kt_help_body'), partial(correctLink, 'src')); | ... | ... |