@@ -5,11 +5,11 @@ import {connect, Provider} from 'react-redux';
55import { Binder , StrapeBinder , keysInit , keysReducer , activeKeyBinder } from '../src' ;
66
77const logger = store => next => action => {
8- console . group ( action . type ) ;
9- console . info ( 'dispatching' , action ) ;
8+ // console.group(action.type);
9+ // console.info('dispatching', action);
1010 const result = next ( action ) ;
11- console . info ( 'next state' , store . getState ( ) ) ;
12- console . groupEnd ( action . type ) ;
11+ // console.info('next state', store.getState());
12+ // console.groupEnd(action.type);
1313 return result ;
1414} ;
1515
@@ -22,32 +22,48 @@ keysInit({store: store});
2222const PureMosaic = ( { binder1, binder2} ) => {
2323 const selectedId1 = binder1 . selectedId ;
2424 const active1 = binder1 . active ;
25+ const binder1Style = {
26+ marginLeft : - binder1 . marginLeft ,
27+ } ;
2528 const selectedId2 = binder2 . selectedId ;
2629 const active2 = binder2 . active ;
30+ const binder2Style = {
31+ marginLeft : - binder2 . marginLeft ,
32+ } ;
2733 return (
28- < div >
29- < Binder id = "binder1" active = { true } onDownExit = "binder2" >
30- < ul >
31- < li id = "b1" className = { active1 && selectedId1 === 'b1' ? 'selected' : '' } > BOUTON 1</ li >
32- < li id = "b2" className = { active1 && selectedId1 === 'b2' ? 'selected' : '' } > BOUTON 2</ li >
33- < li id = "b3" className = { active1 && selectedId1 === 'b3' ? 'selected' : '' } > BOUTON 3</ li >
34- </ ul >
35- </ Binder >
36- < StrapeBinder id = "binder2" onUpExit = "binder1" exitStrategy = "start" >
37- < ul >
38- < li id = "b4" className = { active2 && selectedId2 === 'b4' ? 'selected' : '' } > BOUTON 4</ li >
39- < li id = "b5" className = { active2 && selectedId2 === 'b5' ? 'selected' : '' } > BOUTON 5</ li >
40- < li id = "b6" className = { active2 && selectedId2 === 'b6' ? 'selected' : '' } > BOUTON 6</ li >
41- </ ul >
34+ < div className = "container" >
35+ < StrapeBinder id = "binder1" onDownExit = "binder2" exitStrategy = "start" active = { true }
36+ wrapper = ".wrapper" >
37+ < div className = "wrapper" >
38+ < ul style = { binder1Style } >
39+ < li id = "b1" className = { active1 && selectedId1 === 'b1' ? 'selected' : '' } > BOUTON 1</ li >
40+ < li id = "b2" className = { active1 && selectedId1 === 'b2' ? 'selected' : '' } > BOUTON 2</ li >
41+ < li id = "b3" className = { active1 && selectedId1 === 'b3' ? 'selected' : '' } > BOUTON 3</ li >
42+ < li id = "b4" className = { active1 && selectedId1 === 'b4' ? 'selected' : '' } > BOUTON 4</ li >
43+ < li id = "b5" className = { active1 && selectedId1 === 'b5' ? 'selected' : '' } > BOUTON 5</ li >
44+ < li id = "b6" className = { active1 && selectedId1 === 'b6' ? 'selected' : '' } > BOUTON 6</ li >
45+ </ ul >
46+ </ div >
47+ </ StrapeBinder >
48+ < StrapeBinder id = "binder2" onUpExit = "binder1" exitStrategy = "start" wrapper = ".wrapper" >
49+ < div className = "wrapper" >
50+ < ul style = { binder2Style } >
51+ < li id = "b7" className = { active2 && selectedId2 === 'b7' ? 'selected' : '' } > BOUTON 7</ li >
52+ < li id = "b8" className = { active2 && selectedId2 === 'b8' ? 'selected' : '' } > BOUTON 8</ li >
53+ < li id = "b9" className = { active2 && selectedId2 === 'b9' ? 'selected' : '' } > BOUTON 9</ li >
54+ < li id = "b10" className = { active2 && selectedId2 === 'b10' ? 'selected' : '' } > BOUTON 10
55+ </ li >
56+ < li id = "b11" className = { active2 && selectedId2 === 'b11' ? 'selected' : '' } > BOUTON 11
57+ </ li >
58+ < li id = "b12" className = { active2 && selectedId2 === 'b12' ? 'selected' : '' } > BOUTON 12
59+ </ li >
60+ </ ul >
61+ </ div >
4262 </ StrapeBinder >
4363 </ div >
4464 ) ;
4565} ;
4666
47- function onEnter ( element ) {
48- alert ( 'ELEMENT #' + element . id ) ;
49- }
50-
5167const Mosaic = connect ( state => {
5268 return {
5369 binder1 : state [ '@@keys' ] . getBinder ( 'binder1' ) ,
0 commit comments