1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 10:20:45 +02:00

Progress on inverted switch

This commit is contained in:
Cameron
2017-03-02 19:07:46 -08:00
parent a1dedc5751
commit 551bee9b47
2 changed files with 58 additions and 28 deletions

View File

@@ -25,6 +25,8 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
onText: options.onText || null,
offText: options.offText || null,
wrapperClass: options.wrapperClass || null
// state:
// inverse: options.inverse // this is 'reverse' - default values but reversed order.
});
$(this).on('switchChange.bootstrapSwitch', function (event, state) {
@@ -40,7 +42,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
if(options.inverse)
{
// value = checked ? 0 : 1;
value = checked ? 0 : 1;
}
$('input[type="hidden"][name="' + name + '"]').val(value);