Mockup: subclassing/extending widget patterns

Actually, my proposed solution to customize an existing pattern did not work for me. Instead, this is a solution, which seems to work out:

define([
    'pat-fancyoverlay'
], function(FancyOverlay) {
    'use strict';
    var Modal = FancyOverlay.extend({
        name: 'plone-modal',
        trigger: '.pat-plone-modal'
    });
    return Modal;
});

Here, I have a pattern called pat-fancyoverlay. I want to use this instead of Plone core modal pattern. This extends the fancy overlay pattern and registers it in the Patternslib registry under a new name.

For the records, but unrelated to @seanupton original problem, I register this pattern in require.js via our portal registry in registry.xml like so:

<records prefix="plone.resources/mockup-patterns-modal" interface='Products.CMFPlone.interfaces.IResourceRegistry'>
    <value key="js">++plone++my.projectspecific.resourcedirectory/patterns/mockup-patterns-modal.js</value>
</records>

And here fancy overlay, which will be moved to somewhere else (github/patternslib is accepted), once I feel it's ready: