From 56a621d60aad3005d5e5821e4922b4d3839496c8 Mon Sep 17 00:00:00 2001 From: jlukic Date: Wed, 25 Dec 2013 12:56:36 -0500 Subject: [PATCH] Fixes invoke function in all modules to avoid instance rewrite outside of scope --- src/modules/accordion.js | 20 ++++++++++---------- src/modules/behavior/api.js | 22 +++++++++++----------- src/modules/behavior/form.js | 20 ++++++++++---------- src/modules/behavior/state.js | 20 ++++++++++---------- src/modules/checkbox.js | 20 ++++++++++---------- src/modules/dimmer.js | 22 +++++++++++----------- src/modules/dimmer.less | 12 +----------- src/modules/nag.js | 20 ++++++++++---------- src/modules/rating.js | 20 ++++++++++---------- src/modules/search.js | 20 ++++++++++---------- src/modules/shape.js | 20 ++++++++++---------- src/modules/sidebar.js | 20 ++++++++++---------- src/modules/tab.js | 22 +++++++++++----------- src/modules/transition.js | 5 +++++ src/modules/video.js | 20 ++++++++++---------- 15 files changed, 139 insertions(+), 144 deletions(-) diff --git a/src/modules/accordion.js b/src/modules/accordion.js index 1184ecc3a..4bceeb083 100755 --- a/src/modules/accordion.js +++ b/src/modules/accordion.js @@ -305,13 +305,14 @@ $.fn.accordion = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -319,22 +320,21 @@ $.fn.accordion = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/behavior/api.js b/src/modules/behavior/api.js index 254415210..0b2c87c1a 100755 --- a/src/modules/behavior/api.js +++ b/src/modules/behavior/api.js @@ -450,13 +450,14 @@ }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -464,22 +465,21 @@ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; - } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; + } + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/behavior/form.js b/src/modules/behavior/form.js index 4aaf0266a..40dcb9ede 100755 --- a/src/modules/behavior/form.js +++ b/src/modules/behavior/form.js @@ -486,13 +486,14 @@ $.fn.form = function(fields, parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -500,22 +501,21 @@ $.fn.form = function(fields, parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/behavior/state.js b/src/modules/behavior/state.js index 33da29cf7..e571c8ef0 100755 --- a/src/modules/behavior/state.js +++ b/src/modules/behavior/state.js @@ -542,13 +542,14 @@ $.fn.state = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -556,22 +557,21 @@ $.fn.state = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/checkbox.js b/src/modules/checkbox.js index ac3227608..98eb45302 100755 --- a/src/modules/checkbox.js +++ b/src/modules/checkbox.js @@ -236,13 +236,14 @@ $.fn.checkbox = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -250,22 +251,21 @@ $.fn.checkbox = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/dimmer.js b/src/modules/dimmer.js index aa1c7b1c5..1df34ddc2 100755 --- a/src/modules/dimmer.js +++ b/src/modules/dimmer.js @@ -462,13 +462,14 @@ $.fn.dimmer = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -476,22 +477,21 @@ $.fn.dimmer = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; - } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; + } + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/dimmer.less b/src/modules/dimmer.less index 2ff325289..df1df9c1a 100755 --- a/src/modules/dimmer.less +++ b/src/modules/dimmer.less @@ -113,6 +113,7 @@ overflow: hidden; } +.ui.dimmed.dimmable > .ui.animating.dimmer, .ui.dimmed.dimmable > .ui.visible.dimmer, .ui.active.dimmer { display: block; @@ -137,19 +138,8 @@ .ui.page.dimmer { position: fixed; - -webkit-transform-style: preserve-3d; - -moz-transform-style: preserve-3d; - -ms-transform-style: preserve-3d; transform-style: preserve-3d; - - -webkit-perspective: 2000px; - -moz-perspective: 2000px; perspective: 2000px; - - -webkit-transform-origin: center center; - -moz-transform-origin: center center; - -o-transform-origin: center center; - -ms-transform-origin: center center; transform-origin: center center; } diff --git a/src/modules/nag.js b/src/modules/nag.js index ee3070b08..3fd22de10 100755 --- a/src/modules/nag.js +++ b/src/modules/nag.js @@ -405,13 +405,14 @@ $.fn.nag = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -419,22 +420,21 @@ $.fn.nag = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/rating.js b/src/modules/rating.js index 9a12054d2..56d7141dd 100755 --- a/src/modules/rating.js +++ b/src/modules/rating.js @@ -295,13 +295,14 @@ $.fn.rating = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -309,22 +310,21 @@ $.fn.rating = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/search.js b/src/modules/search.js index 13e47b92c..5cd31474c 100755 --- a/src/modules/search.js +++ b/src/modules/search.js @@ -508,13 +508,14 @@ $.fn.search = function(source, parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -522,22 +523,21 @@ $.fn.search = function(source, parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/shape.js b/src/modules/shape.js index 7690bf694..c517de9de 100755 --- a/src/modules/shape.js +++ b/src/modules/shape.js @@ -663,13 +663,14 @@ $.fn.shape = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -677,22 +678,21 @@ $.fn.shape = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/sidebar.js b/src/modules/sidebar.js index 45a340e9d..70c60e88b 100755 --- a/src/modules/sidebar.js +++ b/src/modules/sidebar.js @@ -402,13 +402,14 @@ $.fn.sidebar = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -416,22 +417,21 @@ $.fn.sidebar = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/tab.js b/src/modules/tab.js index 42422c857..11dc99652 100755 --- a/src/modules/tab.js +++ b/src/modules/tab.js @@ -566,13 +566,14 @@ }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -580,22 +581,21 @@ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; - } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; + } + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } }); diff --git a/src/modules/transition.js b/src/modules/transition.js index 5fe2faceb..64ff99d46 100755 --- a/src/modules/transition.js +++ b/src/modules/transition.js @@ -96,6 +96,11 @@ $.fn.transition = function() { ; }, + refresh: function() { + module.verbose('Refreshing display type on next animation'); + delete instance.displayType; + }, + forceRepaint: function() { module.verbose('Forcing element repaint'); var diff --git a/src/modules/video.js b/src/modules/video.js index c6ae5d8ba..061c3b2de 100755 --- a/src/modules/video.js +++ b/src/modules/video.js @@ -334,13 +334,14 @@ $.fn.video = function(parameters) { }, invoke: function(query, passedArguments, context) { var + object = instance, maxDepth, found, response ; passedArguments = passedArguments || queryArguments; context = element || context; - if(typeof query == 'string' && instance !== undefined) { + if(typeof query == 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function(depth, value) { @@ -348,22 +349,21 @@ $.fn.video = function(parameters) { ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query ; - if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) { - instance = instance[camelCaseValue]; + if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) { + object = object[camelCaseValue]; } - else if( instance[camelCaseValue] !== undefined ) { - found = instance[camelCaseValue]; + else if( object[camelCaseValue] !== undefined ) { + found = object[camelCaseValue]; return false; } - else if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { - instance = instance[value]; + else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) { + object = object[value]; } - else if( instance[value] !== undefined ) { - found = instance[value]; + else if( object[value] !== undefined ) { + found = object[value]; return false; } else { - module.error(error.method, query); return false; } });