Class ::xowiki::BootstrapNavbarModeButton
::xowiki::BootstrapNavbarModeButton
create ... \
[ -CSSclass (default "checkbox-slider--b-flat") ] \
[ -button button ] \
[ -href (default "#") ] \
[ -on:boolean (default "false") ] \
[ -spanStyle (default "padding-left: 6px; padding-right: 6px;") ]
Class Relations
- class: ::xo::tdom::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::MenuItem
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xo::tdom::Class create ::xowiki::BootstrapNavbarModeButton \
-superclass ::xowiki::MenuItem
Methods (to be applied on instances)
CSSclass (setter)
button (setter)
href (setter)
js (scripted)
html::script -type "text/javascript" -nonce [security::csp::nonce] {
html::t {
function mode_button_ajax_submit(form) {
$.ajax({
type: "POST",
url: $(form).attr('action'),
data: $(form).serialize(),
success: function(msg) { location.reload(true); },
error: function(){alert("failure");}
});
};
}
html t [subst {
document.getElementById('${:id}').addEventListener('click', function (event) {
mode_button_ajax_submit(this.form);
});
}]
}on (setter)
render (scripted)
html::li {
html::form -class "form" -method "POST" -action ${:href} {
html::div -class "checkbox ${:CSSclass}" {
html::label -class "checkbox-inline" {
set checked [expr {${:on} ? {-checked true} : ""}]
html::input -id ${:id} -class "debug form-control" -name "debug" -type "checkbox" {*}$checked
html::span -style ${:spanStyle} {html::t ${:text}}
html::input -name "modebutton" -type "hidden" -value "${:button}"
}
}
}
:js
}spanStyle (setter)