Commits

Michael Shepanski committed cba4edf

Fix reference to this inside click callback

Comments (0)

Files changed (1)

     // Initialize the Help Toggle Button
     this.initializeHelpToggle = function() {
         if (this.options.helpToggle && this.options.helpEnabled) {
+            var self = this;  // Required for use inside click callback
             if (this.options.helpToggleElem == undefined)
                 this.options.helpToggleElem = $("<a href='#'>"+ this.options.helpTextShow +"</a>");
             this.options.helpToggleElem.addClass(this.HELPTOGGLECLASS);
             this.options.helpToggleElem.bind('click', function() {
-                if (this.options.containerHelp.is(':visible')) {
-                    this.options.containerHelp.slideUp('fast');
-                    $(this).text(this.options.helpTextShow);
+                if (self.options.containerHelp.is(':visible')) {
+                    self.options.containerHelp.slideUp('fast');
+                    $(this).text(self.options.helpTextShow);
                 } else {
-                    this.options.containerHelp.slideDown('fast');
-                    $(this).text(this.options.helpTextHide);
+                    self.options.containerHelp.slideDown('fast');
+                    $(this).text(self.options.helpTextHide);
                 }
                 return false;
             });