[Kimchi-devel] [PATCH] Fix Bug: Template Tab Broken in Chrome due to Code Error
Hongliang Wang
hlwang at linux.vnet.ibm.com
Mon Jun 9 07:43:17 UTC 2014
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{
--
1.8.1.4
More information about the Kimchi-devel
mailing list