Simplification
This commit is contained in:
		@@ -234,6 +234,16 @@ jQuery(document).ready(function($)
 | 
			
		||||
            URLGeneration(originalAvailableOptions);
 | 
			
		||||
            updateMenu(availableOptions);
 | 
			
		||||
 | 
			
		||||
            function makeFilterChanges()
 | 
			
		||||
            {
 | 
			
		||||
                selectedOptions = gatherURLdata();
 | 
			
		||||
                data = originalData;
 | 
			
		||||
                filterData(selectedOptions);
 | 
			
		||||
                availableOptions = [];
 | 
			
		||||
                availableOptions = gatherData();
 | 
			
		||||
                updateMenu(availableOptions);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // handle tags
 | 
			
		||||
            function handleTags()
 | 
			
		||||
            {
 | 
			
		||||
@@ -249,12 +259,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                    else
 | 
			
		||||
                        $('select[name="tag"]').removeAttr('disabled');
 | 
			
		||||
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $('.box.tags .item-cont').delegate('select[name="tag"]', 'change', function()
 | 
			
		||||
@@ -290,12 +295,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                        $(this).parent().remove();
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
            handleTags();
 | 
			
		||||
@@ -305,13 +305,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                $('input[name="' + name + 's"]').change(function()
 | 
			
		||||
                {
 | 
			
		||||
                    params[name] = []; // remove filter
 | 
			
		||||
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $('input[name="' + name + '"]').change(function()
 | 
			
		||||
@@ -337,12 +331,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                        removeFromArray(params[name], this.id);
 | 
			
		||||
                    }
 | 
			
		||||
                    
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -359,12 +348,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                    else
 | 
			
		||||
                        $('select[name="' + name + '"]').removeAttr('disabled');
 | 
			
		||||
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $('select[name="' + name + '"]').change(function()
 | 
			
		||||
@@ -374,12 +358,7 @@ jQuery(document).ready(function($)
 | 
			
		||||
                    else
 | 
			
		||||
                        params[name].push(this.value);
 | 
			
		||||
 | 
			
		||||
                    selectedOptions = gatherURLdata();
 | 
			
		||||
                    data = originalData;
 | 
			
		||||
                    filterData(selectedOptions);
 | 
			
		||||
                    availableOptions = [];
 | 
			
		||||
                    availableOptions = gatherData();
 | 
			
		||||
                    updateMenu(availableOptions);
 | 
			
		||||
                    makeFilterChanges();
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -390,7 +369,6 @@ jQuery(document).ready(function($)
 | 
			
		||||
            visualFilterCheckboxItem("theme");
 | 
			
		||||
            visualFilterCheckboxItem("dimension");
 | 
			
		||||
            visualFilterCheckboxItem("help");
 | 
			
		||||
 | 
			
		||||
            visualFilterListItem("place");
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user