Commits

Michel Albert  committed a5ecca9

Using goog.ui.AnimatedZippy. Simplifies code.

  • Participants
  • Parent commits 07a17e8

Comments (0)

Files changed (1)

File js/sphinx-folding.js

 
 goog.require('goog.array');
 goog.require('goog.debug');
-goog.require('goog.debug.Logger');
 goog.require('goog.debug.Console');
+goog.require('goog.debug.Logger');
 goog.require('goog.dom');
-goog.require('goog.events');
-goog.require('goog.style');
+goog.require('goog.ui.AnimatedZippy');
 
 
 /**
   goog.array.forEach(classes, function(obj){
     var container = goog.dom.getNextElementSibling(obj);
     if (goog.isDefAndNotNull(container)) {
-      goog.style.showElement(container, false);
+      var zippy = new goog.ui.AnimatedZippy(obj, container, false);
+      zippy.animationDuration = 100;
     }
-    goog.events.listen(obj, goog.events.EventType.CLICK, function(evt) {
-      SphinxFolding.toggleVisibility(this);
-    });
   });
 };
 
 
-SphinxFolding.toggleVisibility = function(obj) {
-  SphinxFolding.LOG.finer("Toggling visibility of sibling of " + obj.tagName);
-  var container = goog.dom.getNextElementSibling(obj);
-  SphinxFolding.LOG.fine("Sibling is " + container);
-  goog.style.showElement(container, !goog.style.isElementShown(container));
-};
-
-
 /**
  * The class logger
  */