1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Bootswitch styling.

This commit is contained in:
Cameron
2017-02-10 09:16:40 -08:00
parent 503fa926ac
commit a631bd5195
4 changed files with 26 additions and 4 deletions

View File

@@ -2322,6 +2322,16 @@ class e_form
$options_off = array_merge($options, array('class' => 'e-expandit-off')); $options_off = array_merge($options, array('class' => 'e-expandit-off'));
} }
if(deftrue('e_DEBUG') && e_ADMIN_AREA === true && empty($label_enabled) && empty($label_disabled))
{
$options['switch'] = 'small';
$options['wrapperClass'] = 'wrapper form-control';
$label_enabled = strtoupper(LAN_ON);
$label_disabled = strtoupper(LAN_OFF);
}
$options_on['label'] = $label_enabled ? defset($label_enabled, $label_enabled) : LAN_ENABLED; $options_on['label'] = $label_enabled ? defset($label_enabled, $label_enabled) : LAN_ENABLED;
$options_off['label'] = $label_disabled ? defset($label_disabled, $label_disabled) : LAN_DISABLED; $options_off['label'] = $label_disabled ? defset($label_disabled, $label_disabled) : LAN_DISABLED;
@@ -2341,6 +2351,12 @@ class e_form
), ),
); );
if(isset($options['wrapperClass']))
{
$js_options[$name]['wrapperClass'] = $options['wrapperClass'];
}
e107::library('load', 'bootstrap.switch'); e107::library('load', 'bootstrap.switch');
e107::js('settings', array('bsSwitch' => $js_options)); e107::js('settings', array('bsSwitch' => $js_options));
e107::js('footer', '{e_WEB}js/bootstrap.switch.init.js', 'jquery', 5); e107::js('footer', '{e_WEB}js/bootstrap.switch.init.js', 'jquery', 5);

View File

@@ -218,8 +218,12 @@ a.tweet_action { font-size:8px }
/* Bootstrap Bug Fix See: https://github.com/twitter/bootstrap/issues/3494 Specific for e107-admin InfoPanel */ /* Bootstrap Bug Fix See: https://github.com/twitter/bootstrap/issues/3494 Specific for e107-admin InfoPanel */
.row-fluid ul.thumbnails li.span12 + li { margin-left : 0px; } .row-fluid ul.thumbnails li.span12 + li { margin-left : 0; }
.row-fluid div.s-message + div { margin-left : 0px; } .row-fluid div.s-message + div { margin-left : 0; }
.bootstrap-switch .bootstrap-switch-label { background: inherit }
.bootstrap-switch.form-control { padding:0; height:auto }
/* /*
.row-fluid ul.thumbXnails li.span6:nth-child(2n + 3) { margin-left : 0px; } .row-fluid ul.thumbXnails li.span6:nth-child(2n + 3) { margin-left : 0px; }

View File

@@ -21,7 +21,8 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$(this).bootstrapSwitch({ $(this).bootstrapSwitch({
size: options.size || 'mini', size: options.size || 'mini',
onText: options.onText || null, onText: options.onText || null,
offText: options.offText || null offText: options.offText || null,
wrapperClass: options.wrapperClass || null
}); });
}); });
}); });

View File

@@ -454,7 +454,7 @@ $(document).ready(function()
}); });
// run tips on .field-help // run tips on .field-help
$("div.tbox,div.checkboxes,input,textarea,select,label,.e-tip").each(function(c) { $("div.tbox,div.checkboxes,input,textarea,select,label,.e-tip,div.form-control").each(function(c) {
var t = $(this).nextAll(".field-help"); var t = $(this).nextAll(".field-help");
@@ -484,6 +484,7 @@ $(document).ready(function()
html: true, html: true,
opacity: 1.0, opacity: 1.0,
placement: placement, placement: placement,
container: 'body',
delay: { show: 300, hide: 600 } delay: { show: 300, hide: 600 }
}); });