Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Javascript cleanups

  • Loading branch information...
commit dad2182e9596a74c316fe1f6a04fd8ff589020e4 1 parent e7bc789
julmis authored

Showing 1 changed file with 11 additions and 10 deletions. Show diff stats Hide diff stats

  1. +11 10 lib/editor/coursefiles.php
21 lib/editor/coursefiles.php
@@ -93,16 +93,17 @@ function set_value(params) {
93 93 }
94 94
95 95 function set_dir(strdir) {
96   - // this function will be rewritten in near future - Janne -
97   - if(window.parent.document.uploader != null) {
98   - window.parent.document.uploader.wdir.value = strdir;
99   - }
100   - if(window.parent.document.cfolder != null) {
101   - window.parent.document.cfolder.wdir.value = strdir;
102   - window.parent.document.cfolder.name.value = "";
103   - }
104   - if(window.parent.document.irename != null) {
105   - window.parent.document.irename.wdir.value = strdir;
  96 + // sets wdir values
  97 + var upper = window.parent.document;
  98 + if(upper) {
  99 + for(var i = 0; i < upper.forms.length; i++) {
  100 + var f = upper.forms[i];
  101 + try {
  102 + f.wdir.value = strdir;
  103 + } catch (e) {
  104 +
  105 + }
  106 + }
106 107 }
107 108 }
108 109

0 comments on commit dad2182

Please sign in to comment.
Something went wrong with that request. Please try again.