[hot] double clicking fix and removed console.log

This commit is contained in:
Rushabh Mehta 2014-08-14 12:43:47 +05:30
parent c0fc9f22ed
commit bddd6529d3
3 changed files with 7 additions and 5 deletions

View file

@ -64,9 +64,6 @@ frappe.ui.form.Layout = Class.extend({
});
if(this.frm)
$(this.frm.wrapper).trigger("refresh-fields");
console.log(this.wrapper.find(".frappe-control:visible"));
setTimeout(function() {
if(!(me.wrapper.find(".frappe-control:visible").length)) {
$('<div class="alert alert-info empty-form-alert">'+__("This form does not have any input")+'</div>')

View file

@ -4,6 +4,8 @@
frappe.provide("frappe.ui.form");
frappe.ui.form.save = function(frm, action, callback, btn) {
$(btn).prop("disabled", true);
var save = function() {
check_name();
if(check_mandatory()) {
@ -16,6 +18,8 @@ frappe.ui.form.save = function(frm, action, callback, btn) {
},
btn: btn
});
} else {
$(btn).prop("disabled", false);
}
};
@ -41,6 +45,7 @@ frappe.ui.form.save = function(frm, action, callback, btn) {
doc.__newname = strip(newname);
} else {
msgprint(__("Name is required"));
$(btn).prop("disabled", false);
throw "name required";
}
}
@ -96,7 +101,7 @@ frappe.ui.form.save = function(frm, action, callback, btn) {
var scroll_to = function(fieldname) {
var f = cur_frm.fields_dict[fieldname];
if(f) {
$(document).scrollTop($(f.wrapper).offset().top + 100);
$(document).scrollTop($(f.wrapper).offset().top - 80);
}
frm.scroll_set = true;
};

View file

@ -166,7 +166,7 @@ $.extend(frappe.ui.toolbar, {
.insertBefore(menu.find(".divider"))
.find("a")
.click(function() {
click();
click.apply(this);
});
},
get_menu: function(label) {