[fix] link selector value should allow for double-quotes in data-value
This commit is contained in:
parent
3c345a6c1d
commit
ea8417acb0
1 changed files with 19 additions and 17 deletions
|
|
@ -76,7 +76,7 @@ frappe.ui.form.LinkSelector = Class.extend({
|
|||
$.each(r.values, function(i, v) {
|
||||
var row = $(repl('<div class="row link-select-row">\
|
||||
<div class="col-xs-4">\
|
||||
<b><a href="#" data-value="%(name)s">%(name)s</a></b></div>\
|
||||
<b><a href="#">%(name)s</a></b></div>\
|
||||
<div class="col-xs-8">\
|
||||
<span class="text-muted">%(values)s</span></div>\
|
||||
</div>', {
|
||||
|
|
@ -84,23 +84,25 @@ frappe.ui.form.LinkSelector = Class.extend({
|
|||
values: v.splice(1).join(", ")
|
||||
})).appendTo(parent);
|
||||
|
||||
row.find("a").click(function() {
|
||||
var value = $(this).attr("data-value");
|
||||
var $link = this;
|
||||
if(me.target.is_grid) {
|
||||
// set in grid
|
||||
me.set_in_grid(value);
|
||||
} else {
|
||||
if(me.target.doctype)
|
||||
me.target.parse_validate_and_set_in_model(value);
|
||||
else {
|
||||
me.target.set_input(value);
|
||||
me.target.$input.trigger("change");
|
||||
row.find("a")
|
||||
.attr('data-value', v[0])
|
||||
.click(function() {
|
||||
var value = $(this).attr("data-value");
|
||||
var $link = this;
|
||||
if(me.target.is_grid) {
|
||||
// set in grid
|
||||
me.set_in_grid(value);
|
||||
} else {
|
||||
if(me.target.doctype)
|
||||
me.target.parse_validate_and_set_in_model(value);
|
||||
else {
|
||||
me.target.set_input(value);
|
||||
me.target.$input.trigger("change");
|
||||
}
|
||||
me.dialog.hide();
|
||||
}
|
||||
me.dialog.hide();
|
||||
}
|
||||
return false;
|
||||
})
|
||||
return false;
|
||||
});
|
||||
})
|
||||
} else {
|
||||
$('<div class="alert alert-info">' + __("No Results")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue