Agriculture module corrections (#13438)

* Agriculture module corrections

* Update ternary_plot.js
This commit is contained in:
Charles-Henri Decultot 2018-04-02 07:21:53 +02:00 committed by Nabin Hait
parent c825e914d1
commit 6860036b01
2 changed files with 6 additions and 6 deletions

View File

@ -15,8 +15,8 @@ frappe.ui.form.on('Soil Texture', {
},
onload: function(frm) {
if (frm.doc.soil_texture_criteria == undefined) frm.call('load_contents');
if (this.ternary_plot) return;
this.ternary_plot = new agriculture.TernaryPlot({
if (frm.doc.ternary_plot) return;
frm.doc.ternary_plot = new agriculture.TernaryPlot({
parent: frm.get_field("ternary_plot").$wrapper,
clay: frm.doc.clay_composition,
sand: frm.doc.sand_composition,

View File

@ -172,17 +172,17 @@ agriculture.TernaryPlot = class TernaryPlot {
make_plot_marking() {
let { triangle_side: t, spacing: s, scaling_factor: p } = this.config;
let clay = this.paper.text(t * Snap.cos(60) / 2, s + t * Snap.cos(30) / 2, "Clay").attr({
let clay = this.paper.text(t * Snap.cos(60) / 2, s + t * Snap.cos(30) / 2, __("Clay")).attr({
fill: frappe.ui.color.get('black')
});
clay.transform("r300");
let silt = this.paper.text(t, s + t * Snap.cos(30) / 2, "Silt").attr({
let silt = this.paper.text(t, s + t * Snap.cos(30) / 2, __("Silt")).attr({
fill: frappe.ui.color.get('black')
});
silt.transform("r60");
let sand = this.paper.text(35 + t * Snap.cos(60), 90 + t * Snap.cos(30), "Sand").attr({
let sand = this.paper.text(35 + t * Snap.cos(60), 90 + t * Snap.cos(30), __("Sand")).attr({
fill: frappe.ui.color.get('black')
});
sand.transform("r0");
@ -229,4 +229,4 @@ agriculture.TernaryPlot = class TernaryPlot {
if (typeof this.blip !== 'undefined')
this.blip.remove();
}
};
};