Просмотр исходного кода

modify href when '#create-page-*' form submitted

Yuki Takei 8 лет назад
Родитель
Сommit
c00ab45c85
2 измененных файлов с 6 добавлено и 2 удалено
  1. 4 0
      lib/views/crowi-plus/new_page.html
  2. 2 2
      resource/js/legacy/crowi.js

+ 4 - 0
lib/views/crowi-plus/new_page.html

@@ -62,6 +62,10 @@
                 <i class="fa fa-pencil-square-o"></i> {{ t('Edit') }}
               </a>
             </li>
+
+            <li class="dropdown pull-right">
+              <a href="#" onclick="history.back();"><i class="fa fa-times"></i> {{ t('Cancel') }}</a>
+            </li>
           </ul>
 
           <div class="tab-content wiki-content">

+ 2 - 2
resource/js/legacy/crowi.js

@@ -213,7 +213,7 @@ $(function() {
     if (input2 === '') {
       prefix2 = prefix2.slice(0, -1);
     }
-    top.location.href = prefix1 + input1 + prefix2 + input2;
+    top.location.href = prefix1 + input1 + prefix2 + input2 + '#edit-form';
     return false;
   });
 
@@ -225,7 +225,7 @@ $(function() {
     if (name.match(/.+\/$/)) {
       name = name.substr(0, name.length - 1);
     }
-    top.location.href = name;
+    top.location.href = name + '#edit-form';
     return false;
   });