adding some tracability into the plugins code
[unfold.git] / plugins / active_filters / static / js / active_filters.js
index 89ebef2..538157e 100644 (file)
@@ -4,20 +4,21 @@
  * License: GPLv3
  */
 
-// NOTE: We are not making use of element, but this.el() instead...
+// NOTE: We are not making use of element, but this.elmt() instead...
 
 (function($){
 
     var ActiveFilters = Plugin.extend({
 
         init: function(options, element) {
+           this.classname="active_filters";
             this._super(options, element);
 
-            this.els('closeButton').click(function() {
+            this.elts('closeButton').click(function() {
                 manifold.raise_event(options.query_uuid, FILTER_REMOVED, filter);
             });
 
-            this.el('clearFilters').click(function () {
+            this.elmt('clearFilters').click(function () {
                 manifold.raise_event(options.query_uuid, CLEAR_FILTERS);
             });
             this.check_and_hide_clear_button();
 
         show_clear_button: function()
         {
-            this.el('clearFilters').show();
+            this.elmt('clearFilters').show();
         },
 
         hide_clear_button: function()
         {
-            this.el('clearFilters').hide();
+            this.elmt('clearFilters').hide();
         },
 
         check_and_hide_clear_button: function()
         {
             // Count the number of filter _inside_ the current plugin
-            var count = this.els('filterButton').length;
+            var count = this.elts('filterButton').length;
             if (count == 1) { // Including the template
-                this.el('clearFilters').hide();
+                this.elmt('clearFilters').hide();
             }
         },
 
 
         add_filter: function(filter)
         {
-            var template = this.el('template').html();
+            var template = this.elmt('template').html();
             var ctx = {
                 id:   this.id(this.id_from_filter(filter, false)),
                 span: this.str_from_filter(filter)
             };
             var output = Mustache.render(template, ctx);
 
-            this.el('myActiveFilters').append(output);
+            this.elmt('myActiveFilters').append(output);
 
             // Add an event on click on the close button, call function removeFilter
             var self = this;
-            this.els('closeButton').last().click(function() {
+            this.elts('closeButton').last().click(function() {
                 manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, filter);
             });
 
@@ -94,7 +95,7 @@
         
         remove_filter: function(filter)
         {
-            this.el(this.id_from_filter(filter, false)).remove();
+            this.elmt(this.id_from_filter(filter, false)).remove();
             this.check_and_hide_clear_button();
         },