@@ -482,31 +482,29 @@ if (COMPILER_TARGET_DEFAULT) {
482482 * @param boolean disableCache
483483 */
484484 _prepareEdit : function ( data , disableCache ) {
485- this . _destroyEditor ( ) ;
486-
487- // update template
488- var self = this ;
489- this . _tab . html ( function ( index , oldHTML ) {
485+ require ( [ "WoltLabSuite/Core/Dom/Util" ] , ( { setInnerHtml } ) => {
486+ this . _destroyEditor ( ) ;
487+
490488 if ( disableCache !== true ) {
491- self . _cachedTemplate = oldHTML ;
489+ this . _cachedTemplate = this . _tab [ 0 ] . innerHTML ;
492490 }
491+
492+ setInnerHtml ( this . _tab [ 0 ] , data . returnValues . template ) ;
493493
494- return data . returnValues . template ;
495- } ) ;
496-
497- // block autocomplete
498- this . _tab . find ( 'input[type=text]' ) . attr ( 'autocomplete' , 'off' ) ;
499-
500- // bind event listener
501- this . _tab . find ( '.formSubmit > button[data-type=save]' ) . click ( $ . proxy ( this . _save , this ) ) ;
502- this . _tab . find ( '.formSubmit > button[data-type=restore]' ) . click ( $ . proxy ( this . _restore , this ) ) ;
503- this . _tab . find ( 'input' ) . keyup ( function ( event ) {
504- if ( event . which === $ . ui . keyCode . ENTER ) {
505- self . _save ( ) ;
506-
507- event . preventDefault ( ) ;
508- return false ;
509- }
494+ // block autocomplete
495+ this . _tab . find ( 'input[type=text]' ) . attr ( 'autocomplete' , 'off' ) ;
496+
497+ // bind event listener
498+ this . _tab . find ( '.formSubmit > button[data-type=save]' ) . click ( $ . proxy ( this . _save , this ) ) ;
499+ this . _tab . find ( '.formSubmit > button[data-type=restore]' ) . click ( $ . proxy ( this . _restore , this ) ) ;
500+ this . _tab . find ( 'input' ) . keyup ( function ( event ) {
501+ if ( event . which === $ . ui . keyCode . ENTER ) {
502+ self . _save ( ) ;
503+
504+ event . preventDefault ( ) ;
505+ return false ;
506+ }
507+ } ) ;
510508 } ) ;
511509 } ,
512510
0 commit comments