Changeset 30738
- Timestamp:
- 12/04/2014 02:03:30 AM (10 years ago)
- Location:
- trunk/src/wp-admin/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/common.js
r30352 r30738 248 248 }); 249 249 250 /** 251 * Ensure an admin submenu is within the visual viewport. 252 * 253 * @since 4.1.0 254 * 255 * @param {jQuery} $menuItem The parent menu item containing the submenu. 256 */ 250 257 function adjustSubmenu( $menuItem ) { 251 258 var bottomOffset, pageHeight, adjustment, theFold, menutop, wintop, maxtop, -
trunk/src/wp-admin/js/customize-controls.js
r30716 r30738 39 39 * Watch all changes to Value properties, and bubble changes to parent Values instance 40 40 * 41 * @since 4.1.0 42 * 41 43 * @param {wp.customize.Class} instance 42 * @param {Array} properties The names of the Value instances to watch.44 * @param {Array} properties The names of the Value instances to watch. 43 45 */ 44 46 api.utils.bubbleChildValueChanges = function ( instance, properties ) { … … 55 57 * Expand a panel, section, or control and focus on the first focusable element. 56 58 * 57 * @param {Object} [params] 59 * @since 4.1.0 60 * 61 * @param {Object} [params] 62 * @param {Callback} [params.completeCallback] 58 63 */ 59 64 focus = function ( params ) { … … 86 91 * If a.priority() === b.priority(), then sort by their respective params.instanceNumber. 87 92 * 93 * @since 4.1.0 94 * 88 95 * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} a 89 96 * @param {(wp.customize.Panel|wp.customize.Section|wp.customize.Control)} b … … 101 108 * Return whether the supplied Event object is for a keydown event but not the Enter key. 102 109 * 110 * @since 4.1.0 111 * 103 112 * @param {jQuery.Event} event 104 113 * @returns {boolean} … … 110 119 /** 111 120 * Return whether the two lists of elements are the same and are in the same order. 121 * 122 * @since 4.1.0 112 123 * 113 124 * @param {Array|jQuery} listA … … 129 140 130 141 /** 131 * Base class for Panel and Section 142 * Base class for Panel and Section. 143 * 144 * @since 4.1.0 132 145 * 133 146 * @class … … 138 151 defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop }, 139 152 153 /** 154 * @since 4.1.0 155 * 156 * @param {String} id 157 * @param {Object} options 158 */ 140 159 initialize: function ( id, options ) { 141 160 var container = this; … … 176 195 177 196 /** 197 * @since 4.1.0 198 * 178 199 * @abstract 179 200 */ … … 182 203 /** 183 204 * Get the child models associated with this parent, sorting them by their priority Value. 205 * 206 * @since 4.1.0 184 207 * 185 208 * @param {String} parentType … … 201 224 /** 202 225 * To override by subclass, to return whether the container has active children. 226 * 227 * @since 4.1.0 228 * 203 229 * @abstract 204 230 */ … … 209 235 /** 210 236 * Handle changes to the active state. 237 * 211 238 * This does not change the active state, it merely handles the behavior 212 239 * for when it does change. … … 214 241 * To override by subclass, update the container's UI to reflect the provided active state. 215 242 * 243 * @since 4.1.0 244 * 216 245 * @param {Boolean} active 217 * @param {Object} args merged on top of this.defaultActiveArguments 246 * @param {Object} args 247 * @param {Object} args.duration 248 * @param {Object} args.completeCallback 218 249 */ 219 250 onChangeActive: function ( active, args ) { … … 231 262 232 263 /** 264 * @since 4.1.0 265 * 233 266 * @params {Boolean} active 234 * @param {Object} [params]267 * @param {Object} [params] 235 268 * @returns {Boolean} false if state already applied 236 269 */ … … 318 351 319 352 /** 353 * @since 4.1.0 354 * 320 355 * @class 321 356 * @augments wp.customize.Class … … 324 359 325 360 /** 361 * @since 4.1.0 362 * 326 363 * @param {String} id 327 * @param {Array} options364 * @param {Array} options 328 365 */ 329 366 initialize: function ( id, options ) { … … 347 384 /** 348 385 * Embed the container in the DOM when any parent panel is ready. 386 * 387 * @since 4.1.0 349 388 */ 350 389 embed: function () { … … 380 419 381 420 /** 382 * Add behaviors for the accordion section 421 * Add behaviors for the accordion section. 422 * 423 * @since 4.1.0 383 424 */ 384 425 attachEvents: function () { … … 403 444 * Return whether this section has any active controls. 404 445 * 405 * @returns {boolean} 446 * @since 4.1.0 447 * 448 * @returns {Boolean} 406 449 */ 407 450 isContextuallyActive: function () { … … 420 463 * Get the controls that are associated with this section, sorted by their priority Value. 421 464 * 465 * @since 4.1.0 466 * 422 467 * @returns {Array} 423 468 */ … … 427 472 428 473 /** 429 * Update UI to reflect expanded state 474 * Update UI to reflect expanded state. 475 * 476 * @since 4.1.0 430 477 * 431 478 * @param {Boolean} expanded 432 * @param {Object} args479 * @param {Object} args 433 480 */ 434 481 onChangeExpanded: function ( expanded, args ) { … … 473 520 474 521 /** 522 * @since 4.1.0 523 * 475 524 * @class 476 525 * @augments wp.customize.Class 477 526 */ 478 527 api.Panel = Container.extend({ 528 /** 529 * @since 4.1.0 530 * 531 * @param {String} id 532 * @param {Object} options 533 */ 479 534 initialize: function ( id, options ) { 480 535 var panel = this; … … 488 543 /** 489 544 * Embed the container in the DOM when any parent panel is ready. 545 * 546 * @since 4.1.0 490 547 */ 491 548 embed: function () { … … 500 557 501 558 /** 502 * 559 * @since 4.1.0 503 560 */ 504 561 attachEvents: function () { … … 544 601 * Get the sections that are associated with this panel, sorted by their priority Value. 545 602 * 603 * @since 4.1.0 604 * 546 605 * @returns {Array} 547 606 */ … … 552 611 /** 553 612 * Return whether this panel has any active sections. 613 * 614 * @since 4.1.0 554 615 * 555 616 * @returns {boolean} … … 570 631 * Update UI to reflect expanded state 571 632 * 572 * @param {Boolean} expanded 573 * @param {Object} args merged with this.defaultExpandedArguments 633 * @since 4.1.0 634 * 635 * @param {Boolean} expanded 636 * @param {Object} args 637 * @param {Boolean} args.unchanged 638 * @param {Callback} args.completeCallback 574 639 */ 575 640 onChangeExpanded: function ( expanded, args ) { … … 793 858 794 859 /** 795 * Bring the containing section and panel into view and then this control into view, focusing on the first input 860 * Bring the containing section and panel into view and then 861 * this control into view, focusing on the first input. 796 862 */ 797 863 focus: focus, … … 802 868 * for when it does change. 803 869 * 804 * @param {Boolean} active 805 * @param {Object} args merged on top of this.defaultActiveArguments 870 * @since 4.1.0 871 * 872 * @param {Boolean} active 873 * @param {Object} args 874 * @param {Number} args.duration 875 * @param {Callback} args.completeCallback 806 876 */ 807 877 onChangeActive: function ( active, args ) { … … 818 888 819 889 /** 820 * @deprecated alias of onChangeActive890 * @deprecated 4.1.0 Use this.onChangeActive() instead. 821 891 */ 822 892 toggle: function ( active ) { … … 827 897 * Shorthand way to enable the active state. 828 898 * 899 * @since 4.1.0 900 * 829 901 * @param {Object} [params] 830 902 * @returns {Boolean} false if already active … … 834 906 /** 835 907 * Shorthand way to disable the active state. 908 * 909 * @since 4.1.0 836 910 * 837 911 * @param {Object} [params] … … 881 955 * 882 956 * The control's container must already exist in the DOM. 957 * 958 * @since 4.1.0 883 959 */ 884 960 renderContent: function () { … … 1292 1368 api.defaultConstructor = api.Setting; 1293 1369 1294 // Create the collection of Control objects.1370 // Create the collections for Controls, Sections and Panels. 1295 1371 api.control = new api.Values({ defaultConstructor: api.Control }); 1296 1372 api.section = new api.Values({ defaultConstructor: api.Section }); … … 1496 1572 1497 1573 /** 1498 * Set the document title of the customizer 1574 * Set the document title of the customizer. 1575 * 1576 * @since 4.1.0 1499 1577 * 1500 1578 * @param {string} documentTitle … … 1629 1707 this.bind( 'url', this.previewUrl ); 1630 1708 1631 // Update the document title when the preview changes 1709 // Update the document title when the preview changes. 1632 1710 this.bind( 'documentTitle', function ( title ) { 1633 1711 api.setDocumentTitle( title ); … … 1769 1847 }); 1770 1848 1771 // Expand/Collapse the main customizer customize info 1849 // Expand/Collapse the main customizer customize info. 1772 1850 $( '#customize-info' ).find( '> .accordion-section-title' ).on( 'click keydown', function( event ) { 1773 1851 if ( api.utils.isKeydownButNotEnterEvent( event ) ) { … … 1944 2022 /** 1945 2023 * Sort panels, sections, controls by priorities. Hide empty sections and panels. 2024 * 2025 * @since 4.1.0 1946 2026 */ 1947 2027 api.reflowPaneContents = _.bind( function () { -
trunk/src/wp-admin/js/customize-widgets.js
r30552 r30738 410 410 }, 411 411 412 /** 413 * @since 4.1.0 414 */ 412 415 initialize: function ( id, options ) { 413 416 var control = this; … … 801 804 * Overrides api.Control.toggle() 802 805 * 803 * @param {Boolean} active 804 * @param {Object} args 806 * @since 4.1.0 807 * 808 * @param {Boolean} active 809 * @param {Object} args 810 * @param {Callback} args.completeCallback 805 811 */ 806 812 onChangeActive: function ( active, args ) { … … 1135 1141 1136 1142 /** 1143 * @since 4.1.0 1144 * 1137 1145 * @param {Boolean} expanded 1138 1146 * @param {Object} [params] … … 1142 1150 1143 1151 /** 1152 * @since 4.1.0 1153 * 1144 1154 * @param {Object} [params] 1145 1155 * @returns {Boolean} false if already expanded … … 1150 1160 * Expand the widget form control 1151 1161 * 1152 * @deprecated alias of expand()1162 * @deprecated 4.1.0 Use this.expand() instead. 1153 1163 */ 1154 1164 expandForm: function() { … … 1157 1167 1158 1168 /** 1169 * @since 4.1.0 1170 * 1159 1171 * @param {Object} [params] 1160 1172 * @returns {Boolean} false if already collapsed … … 1165 1177 * Collapse the widget form control 1166 1178 * 1167 * @deprecated alias of expand()1179 * @deprecated 4.1.0 Use this.collapse() instead. 1168 1180 */ 1169 1181 collapseForm: function() { … … 1379 1391 /** 1380 1392 * Sync the section's active state back to the Backbone model's is_rendered attribute 1393 * 1394 * @since 4.1.0 1381 1395 */ 1382 1396 ready: function () {
Note: See TracChangeset
for help on using the changeset viewer.