Theme Customizer controls API and me 06

A giant leap forward in my knowledge of the Customizer API.

The code

I’ve pushed another iteration to the multi image control repository; it’s not revolutionary in what it does, less than before, but it is in coding structure.
I’ve tried to use the WordPress Customizer JavaScript API and Backbone goodness to slim down my code to mere extensions and invocations of existing APIs.

Extending a control

The key to success in embracing the WordPress Customizer API is to extend the base control class

var MultiImageControl = api.Control.extend({
    // my methods and properties here

I’ve not delved into the Customizer JavaScript code enough but I’ve deducted the api.Control class is not a Backbone.model or a Backbone.View object and so I’ve used it just as a “starting point” for my code leveraging the ready method.
What I get free extending it is access to two fundamental objects needed for a peaceful cooperation with the API:

var MultiImageControl = api.Control.extend({
    // gets the setting of the value stored in the database

    // sets the setting value and enables the Save button

    // allows quickly moving through the control instance markup, a jQuery object     


While the control is not finished it’s nearing the end of its Backbone and Customizer API overhaul; next step is completing that transition.