|
@@ -8603,7 +8603,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
|
|
|
ranges: ranges,
|
|
|
};
|
|
|
var origincallback = function (start, end) {
|
|
|
- $(this.element).val(start.format(options.locale.format) + " - " + end.format(options.locale.format));
|
|
|
+ $(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
|
|
|
$(this.element).trigger('blur');
|
|
|
};
|
|
|
$(".datetimerange", form).each(function () {
|
|
@@ -8758,6 +8758,28 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ switcher: function (form) {
|
|
|
+ form.on("click", "[data-toggle='switcher']", function () {
|
|
|
+ if ($(this).hasClass("disabled")) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var input = $(this).prev("input");
|
|
|
+ input = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : input;
|
|
|
+ if (input.size() > 0) {
|
|
|
+ var yes = $(this).data("yes");
|
|
|
+ var no = $(this).data("no");
|
|
|
+ if (input.val() == yes) {
|
|
|
+ input.val(no);
|
|
|
+ $("i", this).addClass("fa-flip-horizontal text-gray");
|
|
|
+ } else {
|
|
|
+ input.val(yes);
|
|
|
+ $("i", this).removeClass("fa-flip-horizontal text-gray");
|
|
|
+ }
|
|
|
+ input.trigger('change');
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ },
|
|
|
bindevent: function (form) {
|
|
|
|
|
|
}
|
|
@@ -8858,6 +8880,8 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef
|
|
|
events.faselect(form);
|
|
|
|
|
|
events.fieldlist(form);
|
|
|
+
|
|
|
+ events.switcher(form);
|
|
|
},
|
|
|
custom: {}
|
|
|
},
|