浏览代码

[search] Refresh new collection redirects to collection itself

Enrico Berti 11 年之前
父节点
当前提交
4a34768
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 6 1
      apps/search/src/search/templates/search2.mako
  2. 1 1
      apps/search/static/js/search.ko.js

+ 6 - 1
apps/search/src/search/templates/search2.mako

@@ -21,6 +21,12 @@ from django.utils.translation import ugettext as _
 
 ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 
+<script type="text/javascript">
+  if (window.location.hash != ""){
+    location.href = "/search/?" + window.location.hash.substr(1);
+  }
+</script>
+
 <div class="search-bar">
   % if user.is_superuser:
     <div class="pull-right" style="padding-right:50px">
@@ -1384,7 +1390,6 @@ function mapChartDataTransformer(data) {
 
 
 $(document).ready(function () {
-
   $(document).on("showDoc", function(e, doc){
     viewModel.collection.selectedDocument(doc);
     $("#showDocModal").modal();

+ 1 - 1
apps/search/static/js/search.ko.js

@@ -934,7 +934,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       if (data.status == 0) {
         self.collection.id = data.id;
         $(document).trigger("info", data.message);
-        //window.location.hash = '#collection=' + data.id;
+        window.location.hash = '#collection=' + data.id;
       }
       else {
         $(document).trigger("error", data.message);