From 53777076dd28ee4c43b669c6910985c34ed3321d Mon Sep 17 00:00:00 2001 From: Henning Leutz <leutz@pcsg.de> Date: Mon, 30 Jul 2018 08:46:08 +0200 Subject: [PATCH] feat: added load event to qui/controls/buttons/Switch --- qui/controls/buttons/Switch.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/qui/controls/buttons/Switch.js b/qui/controls/buttons/Switch.js index ab65e212..30fc666c 100644 --- a/qui/controls/buttons/Switch.js +++ b/qui/controls/buttons/Switch.js @@ -2,18 +2,15 @@ * QUI Control - On / Off Slide Button * * @module qui/controls/buttons/Switch - * @author www.pcsg.de ( Michael Danielczok ) - * @author www.pcsg.de ( Henning Leutz ) - * - * @require qui/controls/Control - * @require css!qui/controls/buttons/Switch.css + * @author www.pcsg.de (Michael Danielczok) + * @author www.pcsg.de (Henning Leutz) * * @event onCreate * @event onStatusOff * @event onStatusOn * @event onChange + * @event onLoad */ - define('qui/controls/buttons/Switch', [ 'qui/controls/Control', @@ -101,15 +98,15 @@ define('qui/controls/buttons/Switch', [ this.$Elm = new Element('div', { 'class' : 'qui-switch', html : '<div class="qui-switch-off">' + - '<div class="qui-switch-icon-off"></div>' + - '<div class="qui-switch-text-off"></div>' + - '</div>' + - '<div class="qui-switch-on">' + - '<div class="qui-switch-icon-on"></div>' + - '<div class="qui-switch-text-on"></div>' + - '</div>' + - '<div class="qui-switch-button"></div>' + - '<input type="hidden" />', + '<div class="qui-switch-icon-off"></div>' + + '<div class="qui-switch-text-off"></div>' + + '</div>' + + '<div class="qui-switch-on">' + + '<div class="qui-switch-icon-on"></div>' + + '<div class="qui-switch-text-on"></div>' + + '</div>' + + '<div class="qui-switch-button"></div>' + + '<input type="hidden" />', styles : { background: this.$activeColor, opacity : 0 @@ -187,6 +184,8 @@ define('qui/controls/buttons/Switch', [ if (wasDisabled) { this.disable(); } + + this.fireEvent('load', [this]); }.bind(this); this.enable(); -- GitLab