[wp-trac] [WordPress Trac] #26870: Add (JSDoc)umentation to the Backbone-centric Media files
WordPress Trac
noreply at wordpress.org
Thu Feb 6 05:00:29 UTC 2014
#26870: Add (JSDoc)umentation to the Backbone-centric Media files
------------------------------------+-------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.9
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: needs-patch needs-docs | Focuses: docs
------------------------------------+-------------------
Comment (by gcorne):
While doing a bit of jshint work on media-views.js, I noticed:
{{{
/**
* call 'validator' directly on wp.media.model.Selection
*/
&& media.model.Selection.prototype.validator.apply( this, arguments );
}}}
@wonderboymusic, I am not sure it makes sense to document what is
standard, albeit ugly, javascript. This particular case also breaks the
jshint rules and makes the logical expression a bit harder to read, which
is why it jumped out to me. If we feel like these statements are not
clear, maybe we want to introduce a {{{_super()}}} method. I have seen but
not used the following approach for doing this, which we probably would
want to add only at the {{{wp.Backbone}}} or {{{wp.media}}} level.
{{{
Backbone.Model.prototype._super = function(funcName){
return this.constructor.__super__[funcName].apply(this,
_.rest(arguments));
};
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26870#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list