From b60ffab1b0360148e2d178d89a44615b915119aa Mon Sep 17 00:00:00 2001 From: Ernani Azevedo Date: Sat, 5 May 2018 17:47:08 -0300 Subject: [PATCH] Added redraw() method. --- src/js/bootstrap-switch.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/bootstrap-switch.js b/src/js/bootstrap-switch.js index 291ecc38..60745740 100644 --- a/src/js/bootstrap-switch.js +++ b/src/js/bootstrap-switch.js @@ -549,6 +549,12 @@ class BootstrapSwitch { return this.$element; } + redraw() { + this.destroy(); + this.$element.bootstrapSwitch(this.options); + return this.$element; + } + destroy() { const $form = this.$element.closest('form'); if ($form.length) {