This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Recursive Prototype Clonner: | |
* it relies on the following data structure: | |
* <someAncestor data-allow-add="true"> ... | |
* <button class="" data-add="add" | |
* data-add-prototype-node="JQ selector relative to $button.closest('[data-allow-add]'). Will be parameter of $obj.find($selector)" | |
* data-add-prototype-name="<?php echo $prototypeName; ?> optional, defauts to __name__" | |
* data-add-append-node="%data-add-prototype-node% | JQ selector relative to $button.closest('[data-allow-add]'). | |
* Will be parameter of $obj.find($selector)" | |
* data-add-wrapper="html to wrap the cloned item before appending e.g. <li>__PROTOTYPE-CONTENT__</li>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* I needed it 'cause I have a generic js to add embeded subForms to a Form | |
* appending the prototype upon AddButton JQuery click event. So to add event | |
* bindings to one of the controls generated out of the prototype template, which | |
* is unknown to the js that adds it, I fire a message like "prototype_just_added" | |
* and the specific js catches it and binds the event. | |
*/ | |
/* | |
* MediatorPatter implementaton to allow for some behavior extensions. |
NewerOlder