@@ -322,6 +322,17 @@ var control = (function(){
322322element : helper . e ( ".control-header-shade-padding" ) ,
323323path : "header.shade.padding" ,
324324type : "range" ,
325+ additionalEvents : [ {
326+ event : "mousedown" ,
327+ action : function ( ) {
328+ header . edge ( "show" ) ;
329+ }
330+ } , {
331+ event : "mouseup" ,
332+ action : function ( ) {
333+ header . edge ( "hide" ) ;
334+ }
335+ } ] ,
325336func : function ( ) {
326337render ( ) ;
327338header . render ( ) ;
@@ -483,25 +494,24 @@ var control = (function(){
483494link . render ( ) ;
484495}
485496} , {
486- element : helper . e ( ".control-layout-width-fluid" ) ,
487- path : "layout.width" ,
488- type : "radio" ,
489- func : function ( ) {
490- render ( ) ;
491- }
492- } , {
493- element : helper . e ( ".control-layout-width-wide" ) ,
494- path : "layout.width" ,
495- type : "radio" ,
496- func : function ( ) {
497- render ( ) ;
498- }
499- } , {
500- element : helper . e ( ".control-layout-width-thin" ) ,
497+ element : helper . e ( ".control-layout-width" ) ,
501498path : "layout.width" ,
502- type : "radio" ,
499+ type : "range" ,
500+ additionalEvents : [ {
501+ event : "mousedown" ,
502+ action : function ( ) {
503+ layout . edge ( "show" ) ;
504+ }
505+ } , {
506+ event : "mouseup" ,
507+ action : function ( ) {
508+ layout . edge ( "hide" ) ;
509+ }
510+ } ] ,
503511func : function ( ) {
504512render ( ) ;
513+ layout . render ( ) ;
514+ header . render ( ) ;
505515}
506516} , {
507517element : helper . e ( ".control-layout-scroll-past-end" ) ,
@@ -680,10 +690,10 @@ var control = (function(){
680690path : object . path ,
681691newValue : newValue
682692} ) ;
683- // console.log(object.path, helper.getObject({
684- // object: state.get(),
685- // path: object.path
686- // }));
693+ console . log ( object . path , helper . getObject ( {
694+ object : state . get ( ) ,
695+ path : object . path
696+ } ) ) ;
687697} ;
688698} ;
689699var bindControl = function ( object ) {
@@ -704,6 +714,13 @@ var control = (function(){
704714action [ object . element . tagName . toLowerCase ( ) ] ( object ) ;
705715data . save ( ) ;
706716} , false ) ;
717+ if ( object . additionalEvents ) {
718+ object . additionalEvents . forEach ( function ( item , index ) {
719+ object . element . addEventListener ( item . event , function ( ) {
720+ item . action ( ) ;
721+ } , false ) ;
722+ } ) ;
723+ } ;
707724} ;
708725_allControl . forEach ( function ( arrayItem , index ) {
709726bindControl ( arrayItem ) ;
@@ -801,20 +818,16 @@ var control = (function(){
801818urlText [ state . get ( ) . bookmarks . url . style ] ( ) ;
802819} ;
803820var _layout = function ( ) {
804- helper . removeClass ( html , "is-layout-width-fluid" ) ;
805- helper . removeClass ( html , "is-layout-width-wide" ) ;
806- helper . removeClass ( html , "is-layout-width-thin" ) ;
807- helper . addClass ( html , "is-layout-width-" + state . get ( ) . layout . width ) ;
808821if ( state . get ( ) . layout . scrollPastEnd ) {
809822helper . addClass ( html , "is-layout-scroll-past-end" ) ;
810823} else {
811824helper . removeClass ( html , "is-layout-scroll-past-end" ) ;
812825} ;
813826} ;
814827var _theme = function ( ) {
815- helper . removeClass ( html , "is-theme-style-dark" ) ;
816- helper . removeClass ( html , "is-theme-style-light" ) ;
817- helper . addClass ( html , "is-theme-style-" + state . get ( ) . theme . style ) ;
828+ helper . removeClass ( html , "is-theme-style-dark" ) ;
829+ helper . removeClass ( html , "is-theme-style-light" ) ;
830+ helper . addClass ( html , "is-theme-style-" + state . get ( ) . theme . style ) ;
818831} ;
819832var _editAdd = function ( ) {
820833if ( state . get ( ) . header . editAdd . show ) {
0 commit comments