Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Somethings wrong with my filtify.js script in my scenario #68

Open
kasandrica opened this issue May 7, 2018 · 0 comments
Open

Somethings wrong with my filtify.js script in my scenario #68

kasandrica opened this issue May 7, 2018 · 0 comments

Comments

@kasandrica
Copy link

(function ($, window, document, undefined) {

var defaults = {
    noresults: "No results match",
    hide: true,
    block: [],
    close: false,
    query: undefined,
    callback: undefined
};

function Filtrify(containerID, placeholderID, options) {

};
*
*
*
$(function () {

var post = $('ul#filtrifyContainer').find('li'),
ft = $.filtrify("filtrifyContainer", "placeHolder"),        
data = $(post).data(),
genre = $(post).data("genre"),
number = $(post).data("number");            

var Filter = function(category){
    $(post).each(function () {
        var attribute = $(this).data(category);             
        $(this).append('<a class="button small ' + category + '">' + attribute.split(',').join('</a><a class="button small ' + category + '">') + '</a>');              

      $('a.button').click(function (e) {
            e.stopImmediatePropagation(); 
            var buttonText = $.trim($(this).text()); 
          if($(this).hasClass('genre')){
            ft.trigger({genre: [buttonText]});
          }   
          if($(this).hasClass('number')){
            ft.trigger({number: [buttonText]});
          }   
       }); 
    });         
};

if(genre)Filter('genre')
if(number)Filter('number')      

});

Filtrify function are never executed in my scenario. Can anyone help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant