mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
some docs/notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bd729aa46b
commit
2334e0b28e
@ -92,15 +92,25 @@ function(context, cls, data){
|
|||||||
.appendTo(context.ribbons.viewer)
|
.appendTo(context.ribbons.viewer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX write docs:
|
||||||
|
// - cls can be
|
||||||
|
// - a single class (str)
|
||||||
|
// - space separated multiple classes (str)
|
||||||
|
// - list of classes
|
||||||
|
// - if cfg is not given then cls[0] is used for it
|
||||||
|
// - parent can be an element, a getter function or null (defaults to viewer)
|
||||||
var makeButtonControlsToggler =
|
var makeButtonControlsToggler =
|
||||||
module.makeButtonControlsToggler =
|
module.makeButtonControlsToggler =
|
||||||
function(cls, cfg){
|
function(cls, cfg, parent){
|
||||||
cls = cls instanceof Array ? cls : cls.split(/\s+/g)
|
cls = cls instanceof Array ? cls : cls.split(/\s+/g)
|
||||||
cfg = cfg || cls[0]
|
cfg = cfg || cls[0]
|
||||||
|
|
||||||
return toggler.Toggler(null,
|
return toggler.Toggler(null,
|
||||||
function(){
|
function(){
|
||||||
return this.ribbons.viewer.find('.'+ cls.join('.')).length > 0 ? 'on' : 'off' },
|
parent = parent == null ? this.ribbons.viewer
|
||||||
|
: parent instanceof Function ? parent.call(this)
|
||||||
|
: parent
|
||||||
|
return parent.find('.'+ cls.join('.')).length > 0 ? 'on' : 'off' },
|
||||||
['off', 'on'],
|
['off', 'on'],
|
||||||
function(state){
|
function(state){
|
||||||
if(state == 'on'){
|
if(state == 'on'){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user