]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
docs: use event namespace instead of Class name for event doc #11523 11526/head
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 7 Oct 2018 20:38:17 +0000 (22:38 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 7 Oct 2018 20:38:17 +0000 (22:38 +0200)
Document events with the namespace of the triggered event instead of the class name. There is not ideal but this is better than having a documentation that doesn't match the described event.

This fix is compatible with Foundation <= v6.5.0
Closes https://github.com/zurb/foundation-sites/issues/11523

js/foundation.dropdownMenu.js
js/foundation.offcanvas.js

index 2b1d6b77618922033e2c1b195d84ab3748f59e77..9381f2698e2b1c391955c3ea981b252b8e09af39 100644 (file)
@@ -286,7 +286,7 @@ class DropdownMenu extends Plugin {
    * @param {jQuery} $sub - ul element that is a submenu to show
    * @function
    * @private
-   * @fires DropdownMenu#show
+   * @fires Dropdownmenu#show
    */
   _show($sub) {
     var idx = this.$tabs.index(this.$tabs.filter(function(i, el) {
index a6b65045c82d7b5451c935d49ca8e800221f5a8a..c2daa6bac272f8147ac5e6da7f86150ee8e1f2da 100644 (file)
@@ -281,7 +281,7 @@ class OffCanvas extends Plugin {
    * @function
    * @param {Object} event - Event object passed from listener.
    * @param {jQuery} trigger - element that triggered the off-canvas to open.
-   * @fires OffCanvas#opened
+   * @fires Offcanvas#opened
    * @todo also trigger 'open' event?
    */
   open(event, trigger) {
@@ -349,7 +349,7 @@ class OffCanvas extends Plugin {
 
     /**
      * Fires when the off-canvas menu opens.
-     * @event OffCanvas#opened
+     * @event Offcanvas#opened
      */
     this.$element.trigger('opened.zf.offcanvas');
   }
@@ -358,7 +358,7 @@ class OffCanvas extends Plugin {
    * Closes the off-canvas menu.
    * @function
    * @param {Function} cb - optional cb to fire after closure.
-   * @fires OffCanvas#closed
+   * @fires Offcanvas#closed
    */
   close(cb) {
     if (!this.$element.hasClass('is-open') || this.isRevealed) { return; }
@@ -370,7 +370,7 @@ class OffCanvas extends Plugin {
     this.$element.attr('aria-hidden', 'true')
       /**
        * Fires when the off-canvas menu opens.
-       * @event OffCanvas#closed
+       * @event Offcanvas#closed
        */
         .trigger('closed.zf.offcanvas');