MDL-63431 atto_media: Fix non-unique id issues and extend tests.
[moodle.git] / lib / editor / atto / plugins / media / yui / src / button / js / button.js
index 19cc719..6204834 100644 (file)
@@ -169,7 +169,7 @@ var COMPONENTNAME = 'atto_media',
                     '<input name="mform_isexpanded_{{elementid}}_video-advanced-settings" type="hidden">' +
                     '<legend class="ftoggler">{{get_string "advancedsettings" component}}</legend>' +
                     '<div class="fcontainer">' +
-                        '{{> form_components.advanced_settings}}' +
+                        '{{renderPartial "form_components.advanced_settings" context=this id=CSS.VIDEO}}' +
                     '</div>' +
                 '</fieldset>' +
                 '<fieldset class="collapsible collapsed" id="{{elementid}}_video-tracks">' +
@@ -193,7 +193,7 @@ var COMPONENTNAME = 'atto_media',
                     '<input name="mform_isexpanded_{{elementid}}_audio-advanced-settings" type="hidden">' +
                     '<legend class="ftoggler">{{get_string "advancedsettings" component}}</legend>' +
                     '<div class="fcontainer">' +
-                        '{{> form_components.advanced_settings}}' +
+                        '{{renderPartial "form_components.advanced_settings" context=this id=CSS.AUDIO}}' +
                     '</div>' +
                 '</fieldset>' +
                 '<fieldset class="collapsible collapsed" id="{{elementid}}_audio-tracks">' +
@@ -267,21 +267,29 @@ var COMPONENTNAME = 'atto_media',
                 '<div class="{{CSS.ADVANCED_SETTINGS}}">' +
                     '<div class="form-check">' +
                         '<input type="checkbox" checked="true" class="form-check-input {{CSS.MEDIA_CONTROLS_TOGGLE}}"' +
-                        'id="media-controls-toggle"/>' +
-                        '<label class="form-check-label" for="media-controls-toggle">{{get_string "controls" component}}</label>' +
+                        'id="{{id}}_media-controls-toggle"/>' +
+                        '<label class="form-check-label" for="{{id}}_media-controls-toggle">' +
+                        '{{get_string "controls" component}}' +
+                        '</label>' +
                     '</div>' +
                     '<div class="form-check">' +
                         '<input type="checkbox" class="form-check-input {{CSS.MEDIA_AUTOPLAY_TOGGLE}}"' +
-                        'id="media-autoplay-toggle"/>' +
-                        '<label class="form-check-label" for="media-autoplay-toggle">{{get_string "autoplay" component}}</label>' +
+                        'id="{{id}}_media-autoplay-toggle"/>' +
+                        '<label class="form-check-label" for="{{id}}_media-autoplay-toggle">' +
+                        '{{get_string "autoplay" component}}' +
+                        '</label>' +
                     '</div>' +
                     '<div class="form-check">' +
-                        '<input type="checkbox" class="form-check-input {{CSS.MEDIA_MUTE_TOGGLE}}" id="media-mute-toggle"/>' +
-                        '<label class="form-check-label" for="media-mute-toggle">{{get_string "mute" component}}</label>' +
+                        '<input type="checkbox" class="form-check-input {{CSS.MEDIA_MUTE_TOGGLE}}" id="{{id}}_media-mute-toggle"/>' +
+                        '<label class="form-check-label" for="{{id}}_media-mute-toggle">' +
+                        '{{get_string "mute" component}}' +
+                        '</label>' +
                     '</div>' +
                     '<div class="form-check">' +
-                        '<input type="checkbox" class="form-check-input {{CSS.MEDIA_LOOP_TOGGLE}}" id="media-loop-toggle"/>' +
-                        '<label class="form-check-label" for="media-loop-toggle">{{get_string "loop" component}}</label>' +
+                        '<input type="checkbox" class="form-check-input {{CSS.MEDIA_LOOP_TOGGLE}}" id="{{id}}_media-loop-toggle"/>' +
+                        '<label class="form-check-label" for="{{id}}_media-loop-toggle">' +
+                        '{{get_string "loop" component}}' +
+                        '</label>' +
                     '</div>' +
                 '</div>',
             TRACK_TABS: '' +