changeset 4712:b8824b168ca7

javascripts: jQuery version of initFilter
author Takumi IINO <trot.thunder@gmail.com>
date Sat, 29 Nov 2014 17:00:17 +0900
parents ee2993beec85
children 1e78adcba25e
files kallithea/public/js/base.js
diffstat 1 files changed, 15 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Sat Nov 29 16:46:53 2014 +0900
+++ b/kallithea/public/js/base.js	Sat Nov 29 17:00:17 2014 +0900
@@ -894,22 +894,21 @@
         $('#node_filter_box_loading').show();
         $('#search_activate_id').hide();
         $('#add_node_id').hide();
-        YUC.initHeader('X-PARTIAL-XHR',true);
-        YUC.asyncRequest('GET', node_list_url, {
-            success:function(o){
-                nodes = JSON.parse(o.responseText).nodes;
-                $('#node_filter_box_loading').hide();
-                $('#node_filter_box').show();
-                $node_filter.focus();
-                if($node_filter.hasClass('init')){
-                    $node_filter.val('');
-                    $node_filter.removeClass('init');
-                }
-            },
-            failure:function(o){
-                console.log('failed to load');
-            }
-        },null);
+        $.ajax({url: node_list_url, headers: {'X-PARTIAL-XHR': '1'}, cache: false})
+            .done(function(json) {
+                    nodes = json.nodes;
+                    $('#node_filter_box_loading').hide();
+                    $('#node_filter_box').show();
+                    $node_filter.focus();
+                    if($node_filter.hasClass('init')){
+                        $node_filter.val('');
+                        $node_filter.removeClass('init');
+                    }
+                })
+            .fail(function() {
+                    console.log('failed to load');
+                })
+        ;
     }
 
     var updateFilter = function(e) {