Sha256: 67520d0f93d7be2d9fc9f35ff796243ad1a6a2a186f15280165e74072dc54c85

Contents?: true

Size: 1.2 KB

Versions: 196

Compression:

Stored size: 1.2 KB

Contents

$(function(){
  $('#tag_reference').click(function(event){
    event.preventDefault();
    var href = $(this).attr('href');
    $.ajax({
      url: href,
      type: "GET",
      dataType: "html",
      success: function(data, textStatus, xhr){
        $('#popups').append(data);
        Popup.show('tag_reference_popup');
        $('#filter').keyup(function(){

          // Retrieve the input field text and reset the count to zero
          var filter = $(this).val(), count = 0;

          // Loop through the tag list
          $(".tag_description").each(function(){

            // If the list item does not contain the text phrase fade it out
            if ($(this).text().search(new RegExp(filter, "i")) < 0) {
              $(this).fadeOut();

              // Show the list item if the phrase matches and increase the count by 1
            } else {
              $(this).show();
              count++;
            }
          });

          // Update the count
          $("#filter-count").text("Found "+count+" Tags").css("background-color","yellow");
        });
        $('.close_link').click(function(){
          Popup.close();
          $('#tag_reference_popup').remove();
        });
      }
    });
  });
});

Version data entries

196 entries across 196 versions & 1 rubygems

Version Path
trusty-cms-3.9.3 app/assets/javascripts/admin/tags.js
trusty-cms-3.9.2 app/assets/javascripts/admin/tags.js
trusty-cms-4.0.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.9.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.9.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.8.4 app/assets/javascripts/admin/tags.js
trusty-cms-3.8.3 app/assets/javascripts/admin/tags.js
trusty-cms-3.8.2 app/assets/javascripts/admin/tags.js
trusty-cms-3.8.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.8.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.7.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.7.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.6.2 app/assets/javascripts/admin/tags.js
trusty-cms-3.6.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.6.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.5.5 app/assets/javascripts/admin/tags.js
trusty-cms-3.5.4 app/assets/javascripts/admin/tags.js
trusty-cms-3.5.3 app/assets/javascripts/admin/tags.js
trusty-cms-3.5.2 app/assets/javascripts/admin/tags.js
trusty-cms-3.5.1 app/assets/javascripts/admin/tags.js