Changeset - e4721f7ba042
[Not reviewed]
default
0 1 0
Takumi IINO - 11 years ago 2014-11-29 08:31:09
trot.thunder@gmail.com
javascripts: plain javascript version q_filter without YAHOO.namespace
1 file changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -556,16 +556,24 @@ var _close_tooltip = function(e){
 
 *
 
 * @param target: filter input target
 
 * @param nodes: list of nodes in html we want to filter.
 
 * @param display_element function that takes current node from nodes and
 
 *    does hide or show based on the node
 
 */
 
var q_filter = function(target, $nodes, display_element) {
 
var q_filter = (function() {
 
    var _namespace = {};
 
    var namespace = function (target) {
 
        if (!(target in _namespace)) {
 
            _namespace[target] = {};
 
        }
 
        return _namespace[target];
 
    };
 
    return function (target, $nodes, display_element) {
 
    var $nodes = $nodes;
 
    var $q_filter_field = $('#' + target);
 
    var F = YAHOO.namespace(target);
 
        var F = namespace(target);
 

	
 
    $q_filter_field.keyup(function (e) {
 
        clearTimeout(F.filterTimeout);
 
        F.filterTimeout = setTimeout(F.updateFilter, 600);
 
    });
 

	
 
@@ -592,13 +600,14 @@ var q_filter = function(target, $nodes, 
 
            }
 
        });
 

	
 
        $('#repo_count').html(showing);
 
        /* FIXME: don't hardcode */
 
    }
 
};
 
    }
 
})();
 

	
 
/* return jQuery expression with a tr with body in 3rd column and class cls and id named after the body */
 
var _table_tr = function(cls, body){
 
    // like: <div class="comment" id="comment-8" line="o92"><div class="comment-wrapp">...
 
    // except new inlines which are different ...
 
    var comment_id = ($(body).attr('id') || 'comment-new').split('comment-')[1];
0 comments (0 inline, 0 general)