diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index e69d644820..f29d6d762e 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -51,11 +51,11 @@ frappe.ui.form.Control = Class.extend({ if (cint(this.df.hidden)) { if(explain) console.log("By Hidden: None"); return "None"; - + } else if (cint(this.df.read_only)) { if(explain) console.log("By Read Only: Read"); return "Read"; - + } return "Write"; @@ -923,11 +923,14 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({ this._super(); this.set_options(); }, - set_input: function(value) { + set_input: function(value) { // refresh options first - (new ones??) this.set_options(value || ""); - - var input_value = this.$input.val(); + + var input_value = null; + if(this.$input) { + var input_value = this.$input.val(); + } // not a possible option, repair if(this.doctype && this.docname) { @@ -944,7 +947,7 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({ this.set_value(input_value); } } - + this._super(value); }, @@ -963,11 +966,13 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({ } this.last_options = options.toString(); - var selected = this.$input.find(":selected").val(); - this.$input.empty().add_options(options || []); - - if(value===undefined && selected) { - this.$input.val(selected); + if(this.$input) { + var selected = this.$input.find(":selected").val(); + this.$input.empty().add_options(options || []); + + if(value===undefined && selected) { + this.$input.val(selected); + } } }, get_file_attachment_list: function() { diff --git a/frappe/public/js/frappe/ui/page.js b/frappe/public/js/frappe/ui/page.js index d05186ceaa..2899eeea02 100644 --- a/frappe/public/js/frappe/ui/page.js +++ b/frappe/public/js/frappe/ui/page.js @@ -230,14 +230,14 @@ frappe.ui.Page = Class.extend({ get_inner_group_button: function(label) { var $group = this.inner_toolbar.find('.btn-group[data-label="'+label+'"]'); if(!$group.length) { - $group = $('
\ + $group = $('
\ \
').appendTo(this.inner_toolbar.removeClass("hide")); } return $group; }, - + set_inner_btn_group_as_primary: function(label) { this.get_inner_group_button(label).find("button").removeClass("btn-default").addClass("btn-primary"); }, diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js index dbd740b56a..3471b877ab 100644 --- a/frappe/public/js/lib/microtemplate.js +++ b/frappe/public/js/lib/microtemplate.js @@ -8,7 +8,7 @@ frappe.template.compile = function(str, name) { if(!frappe.template.compiled[key]) { if(str.indexOf("'")!==-1) { str.replace(/'/g, "\\'"); - console.warn("Warning: Single quotes (') may not work in templates"); + //console.warn("Warning: Single quotes (') may not work in templates"); } // repace jinja style tags