Преглед изворни кода

Fix path for create new page

WADA Takashi пре 8 година
родитељ
комит
bb0249364d
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      resource/js/legacy/crowi.js

+ 5 - 1
resource/js/legacy/crowi.js

@@ -233,7 +233,11 @@ $(function() {
     if (name.match(/.+\/$/)) {
       name = name.substr(0, name.length - 1);
     }
-    top.location.href = name + '#edit-form';
+    var names = name.split('/');
+    names.forEach(function(item, index) {
+      names[index] = encodeURIComponent(item);
+    });
+    top.location.href = names.join('/') + '#edit-form';
     return false;
   });