From 267a86aefac754b7c72725e09cc6905fa2d035c6 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 31 Aug 2015 09:13:56 -0700 Subject: [PATCH] Issue #2531694 by eiriksm, nod_, dawehner: JSDoc views module --- core/modules/views/js/ajax_view.js | 16 +++++++++++++--- core/modules/views/js/base.js | 9 +++++++++ core/modules/views/js/views-contextual.js | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/core/modules/views/js/ajax_view.js b/core/modules/views/js/ajax_view.js index edfba50c0b7..9145ea929c6 100644 --- a/core/modules/views/js/ajax_view.js +++ b/core/modules/views/js/ajax_view.js @@ -8,10 +8,12 @@ "use strict"; /** - * Attaches the AJAX behavior to Views exposed filter forms and key View - * links. + * Attaches the AJAX behavior to exposed filters forms and key View links. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches ajaxView functionality to relevant elements. */ Drupal.behaviors.ViewsAjaxView = {}; Drupal.behaviors.ViewsAjaxView.attach = function () { @@ -41,7 +43,9 @@ * @constructor * * @param {object} settings + * Settings object for the ajax view. * @param {string} settings.view_dom_id + * The DOM id of the view. */ Drupal.views.ajaxView = function (settings) { var selector = '.js-view-dom-id-' + settings.view_dom_id; @@ -142,8 +146,10 @@ /** * Attach the ajax behavior to a singe link. * - * @param {string} id + * @param {string} [id] + * The ID of the link. * @param {HTMLElement} link + * The link element. */ Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) { var $link = $(link); @@ -168,10 +174,14 @@ }; /** + * Views scroll to top ajax command. * * @param {Drupal.Ajax} [ajax] + * A {@link Drupal.ajax} object. * @param {object} response + * Ajax response. * @param {string} response.selector + * Selector to use. */ Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) { // Scroll to the top of the view. This will allow users diff --git a/core/modules/views/js/base.js b/core/modules/views/js/base.js index d4282299ddc..2fa7f79b8d5 100644 --- a/core/modules/views/js/base.js +++ b/core/modules/views/js/base.js @@ -16,8 +16,10 @@ * Helper function to parse a querystring. * * @param {string} query + * The querystring to parse. * * @return {object} + * A map of query parameters. */ Drupal.Views.parseQueryString = function (query) { var args = {}; @@ -41,9 +43,12 @@ * Helper function to return a view's arguments based on a path. * * @param {string} href + * The href to check. * @param {string} viewPath + * The views path to check. * * @return {object} + * An object containing `view_args` and `view_path`. */ Drupal.Views.parseViewArgs = function (href, viewPath) { var returnObj = {}; @@ -61,8 +66,10 @@ * Strip off the protocol plus domain from an href. * * @param {string} href + * The href to strip. * * @return {string} + * The href without the protocol and domain. */ Drupal.Views.pathPortion = function (href) { // Remove e.g. http://example.com if present. @@ -78,8 +85,10 @@ * Return the Drupal path portion of an href. * * @param {string} href + * The href to check. * * @return {string} + * An internal path. */ Drupal.Views.getPath = function (href) { href = Drupal.Views.pathPortion(href); diff --git a/core/modules/views/js/views-contextual.js b/core/modules/views/js/views-contextual.js index e0fe169d5aa..e6586ebc853 100644 --- a/core/modules/views/js/views-contextual.js +++ b/core/modules/views/js/views-contextual.js @@ -8,8 +8,12 @@ "use strict"; /** + * Attaches contextual region classes to views elements. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Adds class `contextual-region` to views elements. */ Drupal.behaviors.viewsContextualLinks = { attach: function (context) {