Browse Source

add disabling of dialog primary button (#4503)

version-14
Prateeksha Singh 7 years ago
committed by Nabin Hait
parent
commit
af9d7dc07c
3 changed files with 17 additions and 0 deletions
  1. +5
    -0
      frappe/public/css/desk.css
  2. +6
    -0
      frappe/public/js/frappe/ui/dialog.js
  3. +6
    -0
      frappe/public/less/desk.less

+ 5
- 0
frappe/public/css/desk.css View File

@@ -475,6 +475,11 @@ fieldset[disabled] .form-control {
.modal-title {
margin-top: 5px;
}
.btn-primary.disabled {
background-color: #b1bdca;
color: #fff;
border-color: #b1bdca;
}
.form-control {
position: relative;
}


+ 6
- 0
frappe/public/js/frappe/ui/dialog.js View File

@@ -86,6 +86,12 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
click.apply(me, [values]);
});
},
disable_primary_action: function() {
this.get_primary_btn().addClass('disabled');
},
enable_primary_action: function() {
this.get_primary_btn().removeClass('disabled');
},
make_head: function() {
var me = this;
this.set_title(this.title);


+ 6
- 0
frappe/public/less/desk.less View File

@@ -289,6 +289,12 @@ textarea.form-control {
margin-top: 5px;
}

.btn-primary.disabled {
background-color: #b1bdca;
color: #fff;
border-color: #b1bdca;
}

.form-control {
position: relative;



Loading…
Cancel
Save