@@ -355,15 +355,22 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
355
355
*/
356
356
var replaceActionItem = function ( actionitem , image , stringname ,
357
357
stringcomponent , titlestr , titlecomponent , newaction ) {
358
- actionitem . find ( 'img' ) . attr ( 'src' , url . imageUrl ( image , 'core' ) ) ;
358
+
359
359
str . get_string ( stringname , stringcomponent ) . done ( function ( newstring ) {
360
360
actionitem . find ( 'span.menu-action-text' ) . html ( newstring ) ;
361
361
actionitem . attr ( 'title' , newstring ) ;
362
362
} ) ;
363
363
if ( titlestr ) {
364
- str . get_string ( titlestr , titlecomponent ) . done ( function ( newtitle ) {
364
+ str . get_string ( titlestr , titlecomponent ) . then ( function ( newtitle ) {
365
+ templates . renderPix ( image , 'core' , newtitle ) . then ( function ( html ) {
366
+ actionitem . find ( '.icon' ) . replaceWith ( html ) ;
367
+ } ) ;
365
368
actionitem . attr ( 'title' , newtitle ) ;
366
369
} ) ;
370
+ } else {
371
+ templates . renderPix ( image , 'core' , '' ) . then ( function ( html ) {
372
+ actionitem . find ( '.icon' ) . replaceWith ( html ) ;
373
+ } ) ;
367
374
}
368
375
actionitem . attr ( 'data-action' , newaction ) ;
369
376
} ;
@@ -591,4 +598,4 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
591
598
replaceActionItem ( actionitem , image , stringname , stringcomponent , titlestr , titlecomponent , newaction ) ;
592
599
}
593
600
} ;
594
- } ) ;
601
+ } ) ;
0 commit comments