Fix replace() call by removing single quotes and adding leading slash.

This commit is contained in:
Jev Björsell 2014-07-24 13:05:59 -07:00
parent e26f79237c
commit 4e2e3569ad

View file

@ -107,7 +107,7 @@ frappe.ui.form.Attachments = Class.extend({
}
}
// hash is not escaped, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
return encodeURI(file_url).replace('#/g', '%23');
return encodeURI(file_url).replace(/#/g, '%23');
},
remove_attachment_by_filename: function(filename, callback) {
this.remove_attachment(this.get_attachments()[filename], callback);