Merge pull request #12847 from hasnain2808/feat--allow-button-of-different-sizes

feat: allow button of different sizes in df
This commit is contained in:
mergify[bot] 2021-04-26 10:38:29 +00:00 committed by GitHub
commit a0876ce554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,10 @@ frappe.ui.form.ControlButton = frappe.ui.form.ControlData.extend({
make_input: function() {
var me = this;
const btn_type = this.df.primary ? 'btn-primary': 'btn-default';
this.$input = $(`<button class="btn btn-xs ${btn_type}">`)
const btn_size = this.df.btn_size
? `btn-${this.df.btn_size}`
: "btn-xs";
this.$input = $(`<button class="btn ${btn_size} ${btn_type}">`)
.prependTo(me.input_area)
.on("click", function() {
me.onclick();