@@ -356,16 +356,21 @@ function fontWeight(uiElement, weight)
356
356
ID_obj = varargin{4 };
357
357
end
358
358
359
- styleSetStr = sprintf(' dojo.style(dojo.query("[%s = ''%s'' ]")[0], "%s ", "%s ")' ,...
360
- ID_obj .ID_attr , ID_obj .ID_val , styleAttr , styleValue );
361
- % ^ this might result in junk if widgetId=='null'.
362
- try
363
- win .executeJS(styleSetStr );
364
- % ^ this might crash in case of invalid styleAttr/styleValue.
365
- catch ME
366
- % Test for "Invalid or unexpected token":
367
- ME = mlapptools .checkJavascriptSyntaxError(ME , styleSetStr );
368
- rethrow(ME );
359
+ % Handle the case of a non-scalar ID_obj recursively:
360
+ if ~isscalar(ID_obj )
361
+ arrayfun(@(x )mlapptools .setStyle(win , styleAttr , styleValue , x ), ID_obj );
362
+ else
363
+ styleSetStr = sprintf(' dojo.style(dojo.query("[%s = ''%s'' ]")[0], "%s ", "%s ")' ,...
364
+ ID_obj .ID_attr , ID_obj .ID_val , styleAttr , styleValue );
365
+ % ^ this might result in junk if widgetId=='null'.
366
+ try
367
+ win .executeJS(styleSetStr );
368
+ % ^ this might crash in case of invalid styleAttr/styleValue.
369
+ catch ME
370
+ % Test for "Invalid or unexpected token":
371
+ ME = mlapptools .checkJavascriptSyntaxError(ME , styleSetStr );
372
+ rethrow(ME );
373
+ end
369
374
end
370
375
371
376
% Assign outputs:
0 commit comments