Parcourir la source

[minor] control icon

version-14
Rushabh Mehta il y a 8 ans
Parent
révision
a9da206cc2
2 fichiers modifiés avec 9 ajouts et 9 suppressions
  1. +8
    -8
      frappe/public/js/frappe/form/control.js
  2. +1
    -1
      frappe/public/js/frappe/form/formatters.js

+ 8
- 8
frappe/public/js/frappe/form/control.js Voir le fichier

@@ -713,17 +713,17 @@ frappe.ui.form.ControlDatetime = frappe.ui.form.ControlDate.extend({
}); });


frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
make_input: function() { make_input: function() {
var me = this var me = this
var me = this; var me = this;
var _super = this._super; var _super = this._super;
_super.apply(me); _super.apply(me);
import_daterangepicker(function() { import_daterangepicker(function() {
me.refresh(); me.refresh();
me.set_daterangepicker(); me.set_daterangepicker();
}); });
}, },
set_daterangepicker: function() { set_daterangepicker: function() {
@@ -758,7 +758,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
'Last Financial Year': [moment(frappe.defaults.get_default("year_start_date"), "YYYY-MM-DD").subtract(1, 'year'), moment(frappe.defaults.get_default("year_end_date"), "YYYY-MM-DD").subtract(1, 'year')] 'Last Financial Year': [moment(frappe.defaults.get_default("year_start_date"), "YYYY-MM-DD").subtract(1, 'year'), moment(frappe.defaults.get_default("year_end_date"), "YYYY-MM-DD").subtract(1, 'year')]
} }
} }
this.$input.daterangepicker(daterangepicker_options) this.$input.daterangepicker(daterangepicker_options)
.on('apply.daterangepicker',function(ev,picker){ .on('apply.daterangepicker',function(ev,picker){
me.set_input(picker.startDate,picker.endDate) me.set_input(picker.startDate,picker.endDate)
@@ -787,7 +787,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
this.$input && this.$input.val("") this.$input && this.$input.val("")
} }
this.set_disp_area(); this.set_disp_area();
this.set_mandatory && this.set_mandatory(value); this.set_mandatory && this.set_mandatory(value);
}, },
parse: function(value) { parse: function(value) {
@@ -797,7 +797,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
value2 = dateutil.user_to_obj(vals[vals.length-1]); value2 = dateutil.user_to_obj(vals[vals.length-1]);
return [value,value2]; return [value,value2];
} }
}, },
format_for_input: function(value,value2) { format_for_input: function(value,value2) {
if(value && value2) { if(value && value2) {
@@ -805,7 +805,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
value2 = dateutil.str_to_user(value2); value2 = dateutil.str_to_user(value2);
return value + " - " + value2 return value + " - " + value2
} }
return ""; return "";
}, },
validate: function(value, callback) { validate: function(value, callback) {
@@ -1423,7 +1423,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
ui.item.action.apply(me); ui.item.action.apply(me);
} }


// if remember_last_selected is checked in the doctype against the field,
// if remember_last_selected is checked in the doctype against the field,
// then add this value // then add this value
// to defaults so you do not need to set it again // to defaults so you do not need to set it again
// unless it is changed. // unless it is changed.


+ 1
- 1
frappe/public/js/frappe/form/formatters.js Voir le fichier

@@ -59,7 +59,7 @@ frappe.form.formatters = {
if(value) { if(value) {
return '<i class="octicon octicon-check" style="margin-right: 3px;"></i>'; return '<i class="octicon octicon-check" style="margin-right: 3px;"></i>';
} else { } else {
return '<i class="fa fa-ban-circle text-extra-muted" style="margin-right: 3px;"></i>';
return '<i class="fa fa-circle-o text-extra-muted" style="margin-right: 3px; margin-bottom: -2px;"></i>';
} }
}, },
Link: function(value, docfield, options, doc) { Link: function(value, docfield, options, doc) {


Chargement…
Annuler
Enregistrer