You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to specify a class for each "side/span" of the element. Actually, you can only specify the background color of the "On" element and I want to specify a background color for the "Off" element, so I introduced on-class and off-class tags. Here are the changes I made.
Perhaps it will help someone.
I add the following line in the CSS (to be customized) .ats-switch span.btn-primary { background-color: #286090; border-color: #204d74; } .ats-switch span.btn-success { background-color: #5cb85c; border-color: #4cae4c; } .ats-switch span.btn-info { background-color: #5bc0de; border-color: #46b8da; } .ats-switch span.btn-warning { background-color: #f0ad4e; border-color: #eea236; } .ats-switch span.btn-danger { background-color: #d9534f; border-color: #d43f3a; }
And this is how I use it <toggle-switch ng-model="user.is_active" on-label="Active" on-class="btn-success" off-label="Inactive" off-class="btn-danger"> </toggle-switch>
The text was updated successfully, but these errors were encountered:
Hello,
First, thanks for this module.
I need to specify a class for each "side/span" of the element. Actually, you can only specify the background color of the "On" element and I want to specify a background color for the "Off" element, so I introduced on-class and off-class tags. Here are the changes I made.
Perhaps it will help someone.
In angular-toggle-switch.js
``
angular.module('toggle-switch', ['ng']).directive('toggleSwitch', ['$compile', function($compile) {
}]);
``
I add the following line in the CSS (to be customized)
.ats-switch span.btn-primary { background-color: #286090; border-color: #204d74; } .ats-switch span.btn-success { background-color: #5cb85c; border-color: #4cae4c; } .ats-switch span.btn-info { background-color: #5bc0de; border-color: #46b8da; } .ats-switch span.btn-warning { background-color: #f0ad4e; border-color: #eea236; } .ats-switch span.btn-danger { background-color: #d9534f; border-color: #d43f3a; }
And this is how I use it
<toggle-switch ng-model="user.is_active" on-label="Active" on-class="btn-success" off-label="Inactive" off-class="btn-danger"> </toggle-switch>
The text was updated successfully, but these errors were encountered: