Namespace: cq-toggle

WebComponents. cq-toggle

Toggle web component <cq-toggle>.

UI Helper that binds a toggle to an object member, or callbacks when toggled cq-member Object member to observe. If not provided then callbacks will be used exclusively. cq-action default="class" Action to take cq-value default="active" Value for action (i.e. class name) cq-toggles A comma separated list of valid values which will be toggled through with each click. List may include "null".

use registerCallback to receive a callback every time the toggle changes. When a callback is registered, any automatic class changes are bypassed

Example

$("cq-toggle").registerCallback(function(value){
   console.log("current value is " + value);
   if(value!=false) this.node.addClass("active");
})

Methods


Toggle#begin()


Toggle#set(value)

Parameters:
Name Type Description
value

Toggle#updateFromBinding(params)

Parameters:
Name Type Description
params