Need help how to apply JSDoc tags to this Bootstrap-like structure

53 views
Skip to first unread message

Rich Kindle

unread,
Aug 13, 2019, 1:08:15 AM8/13/19
to JSDoc Users
I am trying to document this structure and I'm having little success.  Can someone with more experience than myself provide some insight as to how you would document the following?

(function( FOO, $, undefined ) {


  FOO
.navmgr = {
    DATA_KEY
: 'click.FOO.navmgr.',
    DATA_API_KEY
: '.data-api',
    REQUIRED_PARAMS
: {
      globalNav
: ['uri', 'pagetype'],
   
},
    EVENT_FUNCTIONS
: {
      globalNav
: function(event) {
       
var dataSet = FOO.navmgr._PreNavSetup(event);
       
if(FOO.navmgr._HasRequiredParameters(FOO.navmgr.REQUIRED_PARAMS, dataSet)) {
          FOO
.goPage(dataSet.uri, {'pageType':dataSet.pagetype});  // defined elsewhere
       
}
     
},
      goPage
: function(event) {
       
var dataSet = FOO.navmgr._PreNavSetup(event);
       
if(FOO.navmgr._HasRequiredParameters(FOO.navmgr.REQUIRED_PARAMS, dataSet)) {
          FOO
.navmgr._NavSetup(event,dataSet);
         
var params = {'pageType':dataSet.pagetype};
         
for (var key in dataSet) {
           
if (key.startsWith('p_')) { params[key.substring(2)] = dataSet[key]; }
         
}
          FOO
.navmgr._goPage(dataSet.uri,params);
       
}
     
},
     
:
     
:
   
},
     
   
InitFN: function(scopeRef) {
     
var scope = ((scopeRef !== undefined)&&(scopeRef.length > 0)) ? scopeRef : $(document);
     
for (var key in FOO.navmgr.EVENT_FUNCTIONS) {
       
var eventKey = FOO.navmgr.DATA_KEY + key + FOO.navmgr.DATA_API_KEY,
            dataToggle
= '[data-toggle="'+key+'"]';
        scope
.on(eventKey, dataToggle, FOO.navmgr.EVENT_FUNCTIONS[key]);
     
}
   
},
    _goPage
: function(uri,params) {
     
{Custom code}
   
},
   
:
   
:
 
};


}( window.FOO = window.FOO || {}, jQuery ));


I have taken a few approaches that provide various results, but I'm not happy with anything so far.  I would appreciate any suggestions!




Reply all
Reply to author
Forward
0 new messages