[Kimchi-devel] [PATCH] Fix Bug: Template Tab Broken in Chrome due to Code Error
Daniel H Barboza
danielhb at linux.vnet.ibm.com
Mon Jun 9 11:20:08 UTC 2014
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 06/09/2014 04:43 AM, Hongliang Wang wrote:
> String.prototype.startsWith is a Firefox-specified API and Chrome doesn't
> support it. Replace it with a generic method.
>
> Signed-off-by: Hongliang Wang <hlwang at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.template_main.js | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/js/src/kimchi.template_main.js b/ui/js/src/kimchi.template_main.js
> index eaa5247..48354c9 100644
> --- a/ui/js/src/kimchi.template_main.js
> +++ b/ui/js/src/kimchi.template_main.js
> @@ -22,7 +22,7 @@ kimchi.doListTemplates = function() {
> var listHtml = '';
> var templateHtml = $('#templateTmpl').html();
> $.each(result, function(index, value) {
> - var isLocal = value.cdrom.startsWith("/");
> + var isLocal = /^\//.test(value['cdrom']);
> if(isLocal){
> value.location = "images/theme-default/icon-local.png";
> }else{
More information about the Kimchi-devel
mailing list