diff --git a/libs/PageForms.js b/libs/PageForms.js index aaf3ee2f..73a7f1e2 100644 --- a/libs/PageForms.js +++ b/libs/PageForms.js @@ -1326,7 +1326,11 @@ $.fn.addInstance = function( addAboveCurInstance ) { // Hook that fires each time a new template instance is added. // The first parameter is a jQuery selection of the newly created instance div. - mw.hook('pf.addTemplateInstance').fire(new_div); + if($(new_div).find('.msuploadContainer').length > 0){ + mw.hook('pf.addTemplateInstance').fire(new_div); + } else if ($(new_div).parents('.simplePMG').length > 0){ + mw.hook('pf.addSimplePMG').fire($(new_div).find('.inputSpan').get(0)); + } }; // The first argument is needed, even though it's an attribute of the element