migrating new code to makeCSSClassToggler(..)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-10-09 23:24:14 +04:00
parent 862ba3f203
commit 4138112b82
3 changed files with 7 additions and 2 deletions

View File

@ -37,7 +37,7 @@ module.exitFullscreen = function() {
window.toggleFullscreenMode = window.toggleFullscreenMode =
module.toggleFullscreenMode = createCSSClassToggler( module.toggleFullscreenMode = makeCSSClassToggler(
document.body, document.body,
'.full-screen-mode', '.full-screen-mode',
function(action){ function(action){

View File

@ -99,6 +99,7 @@ var USE_3D_TRANSFORM = true
// we are changing into but the changes are not yet made. // we are changing into but the changes are not yet made.
// NOTE: if the pre-callback explicitly returns false, then the change will // NOTE: if the pre-callback explicitly returns false, then the change will
// not be made. // not be made.
/*
function createCSSClassToggler(elem, class_list, callback_a, callback_b){ function createCSSClassToggler(elem, class_list, callback_a, callback_b){
var bool_action = false var bool_action = false
if(typeof(class_list) == typeof('')){ if(typeof(class_list) == typeof('')){
@ -229,6 +230,7 @@ function createCSSClassToggler(elem, class_list, callback_a, callback_b){
return func return func
} }
*/
// Make a generic toggler function/method... // Make a generic toggler function/method...
@ -281,6 +283,9 @@ function makeToggler(elem, state_accessor, states, callback_a, callback_b){
var action = b == 'next' ? null : b var action = b == 'next' ? null : b
} }
// XXX is this correct???
var args = args2array(arguments).slice(2)
// option number... // option number...
if(typeof(action) == typeof(1)){ if(typeof(action) == typeof(1)){
// range check... // range check...

View File

@ -20,7 +20,7 @@ var browser = require('browser')
//var data = require('data') //var data = require('data')
window.toggleFullscreenMode = window.toggleFullscreenMode =
module.toggleFullscreenMode = createCSSClassToggler( module.toggleFullscreenMode = makeCSSClassToggler(
document.body, document.body,
'.full-screen-mode', '.full-screen-mode',
function(action){ function(action){